Back


Lennie's Weekly Tip: Getting the Screen Saver's Time-Out
22 February  2000 Ref. 13


 

The following function will return the Screen Saver's time-out.
This is the amount of time, in minutes, that the system must be idle before the screen saver activates.
This time-out is set in Windows' Display Properties window in the Screen Saver tab.

function GetScreenSaverTimeOut : integer;

var
 ReturnValue : integer;

begin
    if (SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT, 0, @ReturnValue, 0)) then
     Result := ReturnValue div 60   // Convert seconds into minutes..
   else
     Result := 0;
end;

The SystemParametersInfo function returns a value in seconds.
The function above will convert this value into minutes.
The result is returned, even if the Screen Saver isn't enabled.


Back