对于我的一个应用程序,我想在点击一个按钮后将其发送到快照视图.据我所知,没有可用的公共API将正在运行的应用程序发送到快照视图.有没有人找到解决方法来做到这一点?
For one of my apps I'd like to send the app to snapped view after tapping a button. As far as I know there's no public API available to send a running application to snapped view. Did anyone find a workaround to do this?
应该可以,因为您可以在Windows 8本身中完成操作,并捕捉其中一个正在运行的应用程序.
Somehow it should be possible since you're able to do it in Windows 8 itself, and snap one of the running apps.
更新:能够触发Win +.也许可以达到相同的效果,但是 SendKeys WinRT中也不提供API.
Update: Being able to trigger a Win+. might do the same trick, but the SendKeys API isn't available in WinRT either.
推荐答案Windows 10具有 ApplicationView.TryResizeView 方法
Windows 10 has a ApplicationView.TryResizeView method
所以...总结一下有趣的WinRT旅程:
So... to summarize the interesting WinRT journey:
具有锁定"模式,只有一个用户可以启动.开发人员可以尝试使用TryUnsnap方法取消捕捉
Has a a 'Snapped' mode that a only a user can initiate. the developer can try to unsnap with the TryUnsnap method
没有快照模式,并且不推荐使用TryUnsnap.开发人员仍然可以监听窗口大小的变化,并知道应用程序视图是否像以前一样小.
Does not have Snapped mode, and TryUnsnap is deprecated. The dev can still listen for window size changes and know if the app view is in a smaller size as before.
引入了 ApplicationView.TryResizeView 方法,开发人员可以在其中尝试进行调整.窗口大小更改事件仍然存在.
Introduced the ApplicationView.TryResizeView method, where the dev can try to resize. Window size changed event is still there.
ApplicationView.GetForCurrentView().TryResizeView(new size(width, height)));更多推荐
强制WinRT应用程序捕捉视图
发布评论