How to detect user idle in UWP?

岁酱吖の 提交于 2020-01-23 13:03:20

问题


I want to know how to detect user idle in UWP. I mean not the case user idle for the app, but for the whole system/OS: no keyboard input, no mouse operation, no touch even when no focus on the app or app is minimized.

I find some other post about it. Like this: How to check if user is idle on UWP? And it uses below method:

Window.Current.CoreWindow.PointerMoved += onCoreWindowPointerMoved;

I tested and found that if my mouse moves outside of the app window, then onCoreWindowPointerMoved() will not be executed. It means this method can not detect user idle on the whole system.


回答1:


How to detect user idle in UWP?

For security reason, we could not implement this in UWP platform, But we could implement this in legacy win32 app, and use FullTrustProcessLauncher to run the win32 app to detect the system idle. then use AppService pass the status to UWP app. For more please refer this tutorial



来源:https://stackoverflow.com/questions/58687035/how-to-detect-user-idle-in-uwp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!