Does somebody know how to detect a Windows suspend message by C/C++ code?
Or, does SetWindowsHookEx()
function do this?
Does somebody have these code for me? I want to detect this message.
Does somebody know how to detect a Windows suspend message by C/C++ code?
Or, does SetWindowsHookEx()
function do this?
Does somebody have these code for me? I want to detect this message.
If you are talking about sleep and hibernate – the answer is yes, you can. You just need to listen to
WM_POWERBROADCAST
message.Suppose you have an MFC application and a window class which is a subclass of
CWnd
. Then you can do: