function SetScreenSaverTimeOut(Minutes : integer) : boolean;
var
Sec : integer;
begin
if (Minutes in [1..60]) then
begin
Sec := Minutes * 60; // Convert minutes into seconds.
Result := SystemParametersInfo(SPI_SETSCREENSAVETIMEOUT, Sec, nil, 0);
end
else
Result := False;
end;