How to check if the system is in standby mode?
I want to check if the system is idle, is there a Win32 API for this? I'm not sure if it's the same as hibernation.
There's some code in there that runs in my application that makes it hang when coming out of standby (it runs in standby), so I would not want to run this code when the computer is sleeping / standing.
Thanks in advance!
Dennis
edit: it might not be possible because the program shouldn't work as stated in the answer below, so I'll count that as an answer :)
+1
source to share
3 answers
If your program is running, you are not in standby mode.
I think you want to handle WM_POWERBROADCAST messages . They will tell you when the system changes its power state, and before Vista you can get angry and veto the system shutdown if you want.
0
source to share