资源简介
最近微软开源了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及源码
相关资源
- 国际象棋的qt源代码
- C++中头文件与源文件的作用详解
- C++多线程网络编程Socket
- VC++ 多线程文件读写操作
- 利用C++哈希表的方法实现电话号码查
- 移木块游戏,可以自编自玩,vc6.0编写
- C++纯文字DOS超小RPG游戏
- VC++MFC小游戏实例教程(实例)+MFC类库
- 连铸温度场计算程序(C++)
- 6自由度机器人运动学正反解C++程序
- Em算法(使用C++编写)
- libstdc++-4.4.7-4.el6.i686.rpm
- VC++实现CMD命令执行与获得返回信息
- 白话C++(全)
- C++标准库第1、2
- 大数类c++大数类
- C++语言编写串口调试助手
- c++素数筛选法
- C++ mqtt 用法
- 商品库存管理系统 C++ MFC
- c++ 多功能计算器
- C++17 In Detail
- 嵌入式QtC++编程课件
- 颜色识别形状识别STM103嵌入式代码
- Win10数字权利激活自动批处理版2020-
- c++ 邮件多附件群发
- c++ 透明代理(hookproxy)
- mfc 调用redis
- FTP客户端源码(c++)
- c++ 画图(14Qt-XPS)
评论
共有 条评论