c – W8服务的已连接待机通知

我有一个在Windows 8(和8.1)上运行的C开发的服务.如何才能知道系统已进入Connected Standby?

由于这是一个服务,它没有窗口,我应该使用PowerRegisterSuspendResumeNotification,但它似乎没有工作.有谁知道我怎么得到这样的通知?

解决方法:

我已经联系了微软的技术支持.这是他们的答案:

There are no direct notifications for ConnectedStandby enter/exit, but you can just use the monitor on/off notifications since ConnectedStandby is synonymous with screen off on an AOAC capable system (but is not on a legacy system, AOAC capability can be had by getting SystemPowerCapabilities using CallNtPowerInformation and looking at the AoAc value of the SYSTEM_POWER_CAPABILITIES struct).

To get monitor on/off notifications you can use RegisterPowerSettingNotification and use the GUID_MONITOR_POWER_ON power setting GUID.

通过监听屏幕开/关事件看起来只有一个解决方法.

上一篇:Unity编辑器扩展学习(三)——几个常用影响GUILayout渲染的API


下一篇:【Matlab人脸识别】KL变换人脸识别【含GUI源码 859期】