开发者

Detecting screen monitor Power State change in c++

开发者 https://www.devze.com 2023-02-02 17:49 出处:网络
I have a Windows mes开发者_如何转开发sage loop. I need to detect when the screen powers back up. Is there a windows message?

I have a Windows mes开发者_如何转开发sage loop. I need to detect when the screen powers back up. Is there a windows message?

detect power state change contains the C# way, I need the C++ way, using win32 API.

If there isn't a Windows message, how do I poll for screen monitor power state?


There is a Windows message WM_POWERBROADCAST. There Windows API has a lot of support for power management. See the section on Windows Power Management at MSDN for the details.


For newer windows versions (starting with windows 8) you should use GUID_CONSOLE_DISPLAY_STATE instead of GUID_MONITOR_POWER_ON

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号