Possible to find all Windows processes preventing automatic sleep, w/o admin rights?

不想你离开。 提交于 2020-01-13 04:00:06

问题


The command powercfg -requests will provide a list of processes that are currently preventing a Windows 10 device from automatically entering sleep mode. However, the command requires administrator permissions. Asking for admin access just to perform a simple informational query seems far from ideal.

So is it possible to query the Windows 10 API for a similar list, in a user-space application?

These processes are passing SetThreadExecutionState() the flags ES_SYSTEM_REQUIRED or ES_DISPLAY_REQUIRED. But I don't see any function to query a list of registered execution states.

来源:https://stackoverflow.com/questions/36826733/possible-to-find-all-windows-processes-preventing-automatic-sleep-w-o-admin-rig

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