Activate/Deactivate the Windows ScreenSaver  

Send By: Radikal (Q3 Team)
Web : http://www.q3.nu
Email: radikal@q3.nu
Date: 23/11/99

Tip accessed 471 times

 


Simply we eill use the API function: SystemParametersInfo




Know if it is activated




 procedure TForm1.Button1Click(Sender: TObject);
 var
    SC_Status  : integer;
 begin
  {Save if it is activated or not}
  SystemParametersInfo(SPI_GETSCREENSAVEACTIVE,0,@SC_Status,0);
  if SC_Status=1 then ShowMessage('ACTIVADO/ACTIVE')
                 else ShowMessage('DESACTIVADO/NOT ACTIVE');
 end;






Deactivate it




  SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,0,NIL,SPIF_SENDWININICHANGE);






Activate it




  SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,1,NIL,SPIF_SENDWININICHANGE);