unixman83
unixman83

Reputation: 9933

Detecting screen monitor Power State change in c++

I have a Windows message 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?

Upvotes: 2

Views: 6950

Answers (2)

dizzer
dizzer

Reputation: 126

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

Upvotes: 0

shf301
shf301

Reputation: 31394

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.

Upvotes: 3

Related Questions