资源简介
最近微软开源了Win10上的计算器代码,并且此次微软抛弃了自己的亲儿子C#,改用C++,喜大普奔,VS2017可直接编译
代码片段和文件信息
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using Etw.Managed;
using Microsoft.OneCoreUap.Test.AppModel;
using MS.Internal.Mita.Foundation;
using MS.Internal.Mita.Foundation.Controls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using Calculator.UIAutomationLibrary.Components;
using WEX.Logging.Interop;
namespace Calculator.UIAutomationLibrary
{
///
/// Class that can open and close the Calculator app.
///
public static class CalculatorAppLauncher
{
public const string CoreWindowClassName = “Windows.UI.Core.CoreWindow“;
// This doesn‘t actually work right now because popup will disappear
// Bug 13713223: ContentDialog/Popup does not show up in the UIA tree when Windows.Current.Content has an AutomationName set.
// public static readonly UICondition TopLevelWindowUICondition = UICondition.CreateFromId(Constants.TopLevelWindowAutomationId);
public static readonly UICondition CoreWindowUICondition = UICondition.CreateFromClassName(CoreWindowClassName)
.AndWith(UICondition.CreateFromName(Constants.AppWindowName));
///
/// Launch the app
///
public static CalculatorAppLfm Launch()
{
Log.Comment(“Launching Calculator and waiting for first page load...“);
// Need to set this for the MITALite Tap~ methods to work on high DPI screens.
UAPApp.SetTestDPIAwareness();
// We want to be able to see any element in the tree
Context.RawContext.Activate();
// Set default wait timeout.
MS.Internal.Mita.Foundation.Waiters.Waiter.DefaultTimeout = TimeSpan.FromSeconds(30);
// Enable Mita internal logging.
MS.Internal.Mita.Foundation.Utilities.Log.OutImplementation = (s a) => { Log.Comment($“- [MitaLite] { string.Format(s a) }“); };
using (EtwWaiter appLaunchWaiter = new EtwWaiter(Constants.CalculatorETWProviderGUID Constants.AppLaunchEndETWEventName))
{
var viewDescriptor = Navigationhelper.LaunchApplication(Constants.PackageAppUserModelId);
appLaunchWaiter.Wait(TimeSpan.FromSeconds(30));
Window calculatorWindow = new Window(UIobject.Root.Descendants.Find(CoreWindowUICondition));
Debug.Assert(calculatorWindow.ClassName == CoreWindowClassName);
// Move our window to the foreground.
WindowHelper.SetAsForeground(calculatorWindow.GetTopLevelWindow());
return new CalculatorAppLfm(new CalculatorAppPom(calculatorWindow) viewDescriptor);
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-03-16 04:21 calculator-master\
文件 207 2019-03-16 04:21 calculator-master\.editorconfig
文件 2492 2019-03-16 04:21 calculator-master\.gitattributes
目录 0 2019-03-16 04:21 calculator-master\.github\
目录 0 2019-03-16 04:21 calculator-master\.github\ISSUE_TEMPLATE\
文件 1178 2019-03-16 04:21 calculator-master\.github\ISSUE_TEMPLATE\bug_report.md
文件 1580 2019-03-16 04:21 calculator-master\.github\ISSUE_TEMPLATE\feature_request.md
文件 336 2019-03-16 04:21 calculator-master\.github\pull_request_template.md
文件 4963 2019-03-16 04:21 calculator-master\.gitignore
文件 351 2019-03-16 04:21 calculator-master\CODE_OF_CONDUCT.md
文件 5677 2019-03-16 04:21 calculator-master\CONTRIBUTING.md
文件 1095 2019-03-16 04:21 calculator-master\LICENSE
文件 1772 2019-03-16 04:21 calculator-master\NOTICE.txt
文件 3806 2019-03-16 04:21 calculator-master\README.md
目录 0 2019-03-16 04:21 calculator-master\Tools\
目录 0 2019-03-16 04:21 calculator-master\Tools\PGO\
文件 716 2019-03-16 04:21 calculator-master\Tools\PGO\Microsoft.WindowsCalculator.PGO.nuspec
目录 0 2019-03-16 04:21 calculator-master\Tools\PGO\build\
目录 0 2019-03-16 04:21 calculator-master\Tools\PGO\build\native\
文件 244 2019-03-16 04:21 calculator-master\Tools\PGO\build\native\Microsoft.WindowsCalculator.PGO.props
文件 2468 2019-03-16 04:21 calculator-master\Tools\PGO\build\native\Microsoft.WindowsCalculator.PGO.targets
目录 0 2019-03-16 04:21 calculator-master\build\
目录 0 2019-03-16 04:21 calculator-master\build\config\
文件 392 2019-03-16 04:21 calculator-master\build\config\LocConfigPackageEs.xm
文件 410 2019-03-16 04:21 calculator-master\build\config\SignConfig.xm
目录 0 2019-03-16 04:21 calculator-master\build\config\TRexDefs\
目录 0 2019-03-16 04:21 calculator-master\build\config\TRexDefs\amd64\
文件 1369 2019-03-16 04:21 calculator-master\build\config\TRexDefs\amd64\performance.xm
文件 1071 2019-03-16 04:21 calculator-master\build\config\TRexDefs\amd64\rs4_release.xm
文件 1113 2019-03-16 04:21 calculator-master\build\config\TRexDefs\amd64\rs5_release.xm
文件 2068 2019-03-16 04:21 calculator-master\build\config\TRexDefs\amd64\rs_apps_validate.xm
............此处省略874个文件信息
- 上一篇:C语言实现2的指数次点的FFT
- 下一篇:C语言-ATM机模拟系统exe及源码
相关资源
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- Win10数字权利激活自动批处理版2020-
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
- c++多边形交并差运算
- VC++基于OpenGL模拟的一个3维空间模型
- c++ 虚拟摄像头
- hook,捕获所有案件,查找所有窗口,
- C语言课设计算器
- c++ 简易贪吃蛇源码
- 高精度加法(c++代码)
- C++调用百度地图案例
- 北京化工大学计算方法(C/C++)讲义
- 基于VC++的SolidWorks二次开发SolidWorks
- c++ 模拟鼠标按键
- OFD编辑器
- Beginning C++17 From Novice to Professional
- C++ STL实现
- opencv手部轮廓识别以及轨迹识别
- 百度C++编码规范
- 基于51单片机的简易计算器
- C++ sql2008 WebServer通讯.docx
- c++ 定时关机程序源码
- 基于VSCode和CMake实现C++开发
- c++语法查询工具
评论
共有 条评论