How to detect the current status of the video (monitor, display)?
Is it in normal mode, running screen saver or it is turn off for energy saving?
How can I detect it?
Posted on 2008-04-26 20:49:37 by sonthakit
Oh, I found detecting the screen saver.

invoke SystemParametersInfo,SPI_GETSCREENSAVERRUNNING,0,addr Saver,0

from http://msdn2.microsoft.com/en-us/library/ms724947.aspx

But I still not found how to detect monitor turn off.
Posted on 2008-04-27 00:52:35 by sonthakit
In your WndProc you can do:

mov EAX, uMsg
cmp EAX, WM_SYSCOMMAND
jz .wm_syscommand
...
.wm_syscommand:
mov EAX, wParam
cmp EAX, SC_SCREENSAVE
jz .screensaver_handler
cmp EAX, SC_MONITORPOWER
jz .monitorpower_handler
...


...or something similiar.
Posted on 2008-04-27 01:26:03 by Synfire
Sorry, the SC_SCREENSAVE only send to the active window, not the backgroud window and
SC_MONITORPOWER is not the notificatin message but it is the setting message, only for win95.

I found the notification message for monitor turning off only for windows vista. I work on XP.
Posted on 2008-04-27 01:39:17 by sonthakit
I believe this link contains anwers to all of your questions :)
Posted on 2008-04-27 02:25:26 by ti_mo_n