如何从 Windows 10 移动版应用程序中锁定屏幕?
我正在搜索 UWP API 参考,但没有找到如何从应用程序内或使用辅助磁贴锁定设备的方法.
I was searching through UWP API Reference and I didn't find any way how to Lock the device from within app or with Secondary Tile.
我很沮丧,因为有证据表明它可以做到.我不想在这里做任何广告,但例如这个应用程序:https://www.microsoft.com/en-us/store/apps/quicktiles/9wzdncrfhzts可以创建仅锁定屏幕的辅助磁贴.
And I am frustrated, because there is a proof that it can be done. I don't want to make any advertisements here but for example this app: https://www.microsoft.com/en-us/store/apps/quicktiles/9wzdncrfhzts Can create secondary tile that just locks the screen.
我如何自己做?
谢谢.
我认为 UWP 库是不可能的.我试图做一个能够锁定屏幕的应用程序,但几周前不得不放弃.
I don’t think it is possible with the UWP libraries. I tried to do an app able to lock the screen and had to give up few week-end ago.
你可以在这里投票支持这样的想法:
You could vote for such idea here :
- https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/2854511-provide-api-to-lock-unlock-the-screen-and-provi
- https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/6220483-api-to-lock-the-screen
阅读您提到的应用程序的评论,它似乎使用hack"来实现锁定屏幕,但它似乎有副作用:
Reading the review of the application you mentioned it seems it use a "hack" to achieve the lock screen but it seems to have side effects:
- 锁定手机后,设备非常热,电池电量下降非常快.请修复它."
- 但是,在锁定屏幕后,它会导致手机非常热且电池消耗严重"
- 有时在我锁定屏幕后,电池会变热,直到我解锁手机"
我也很惊讶 UWP 没有提供这样的功能......
I’m also very surprise that UWP do not offer such functionality…