Mega Code Archive

 
Categories / Delphi / Examples
 

How do i switch the monitor on- off using objectpascal

Provided that you monitor supports this interface, you can use the new system command message SC_MONITORPOWER as shown in the following function: // Power saver mode interface procedure SwitchMonitorOn (on : boolean); const lp : array [false..true] of longint = (0, -1); begin SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, lp[on]); end;