Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to turn the monitor off/on via code? 2

Status
Not open for further replies.

imagenetics

Programmer
Dec 8, 2003
66
PL
How can I turn the monitor off and on at application's runtime? I know about SendMessage(Application->Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 0); but it doesn't work (I use Windows XP but I'm not sure if it has something to do with it).
 
'0' is an invalid monitor state, This should work:

Code:
  #define MonitorOn -1
  #define MonitorOff 2
  #define MonitorStandby 1

  SendMessage(Application->Handle, WM_SYSCOMMAND, SC_MONITORPOWER, MonitorOff);
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top