以编程方式最小化 UWP [英] Minimize UWP programmatically

查看:22
本文介绍了以编程方式最小化 UWP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

现在有没有办法以编程方式最小化 UWP 应用程序?我的应用将在平板电脑上以全屏模式运行,我不想拖动顶部边缘来调用默认的最小化按钮.

Is there a way to minimize UWP application programmatically now? My app will working on tablet in full screen mode and I don't want to drag top edge to call default minimize button.

推荐答案

在 Windows 10 更新 1803(内部版本 17134)中,有一个新的 API 可用于最小化您的应用程序.

With the Windows 10 update 1803 (build 17134), there is a new API that can be used to minimize your application.

IList<AppDiagnosticInfo> infos = await AppDiagnosticInfo.RequestInfoForAppAsync();
IList<AppResourceGroupInfo> resourceInfos = infos[0].GetResourceGroups();
await resourceInfos[0].StartSuspendAsync();

https://docs.microsoft.com/en-us/uwp/api/windows.system.appresourcegroupinfo.startsuspendasync

使用此 API 目前需要您在内部构建的清单中声明appDiagnostics"功能.今后,不需要最小化您自己的应用程序,只需要最小化其他应用程序.

Using this API currently requires you to declare the 'appDiagnostics' capability in your manifest on insider builds. Going forward it should not be required for minimizing your own app, only for minimizing other apps.

这篇关于以编程方式最小化 UWP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆