Examples Delphi

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;