My app needs to block sleep/hibernate mode. I have the code in place, but after successfully catching the WM_POWERBROADCAST message, neither PBT_APM
Try to subscribe the PowerModeChanged event:
How do I check when the computer is being put to sleep or wakes up?