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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Monitor power down

Status
Not open for further replies.

hlybbi

Programmer
Mar 19, 2003
91
0
0
IS
I am using this code to power down my monitor on xp without sp2
const int MONITOR_ON = -1;
const int MONITOR_OFF = 2;
const int WM_SYSCOMMAND = 0x0112;
const int SC_MONITORPOWER = 0xF170;
const UInt32 ES_CONTINUOUS = 0x80000000;

System.Threading.Thread.Sleep(2000);
PostMessage(GetDesktopWindow(), WM_SYSCOMMAND, SC_MONITORPOWER, ScreenValue);
System.Threading.Thread.Sleep(2000);

when i upgrade computer to sp2 this doesn´t work can anybody help me

Best regards Hlynur
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top