Activate a screen saver then stop it

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

Is there any way to start a screen saver and then stop it? Do I need to use
Process? I tried to use Process to start a screen saver but could not stop
it even I killed the process.

Thanks for any help,

Tedmond
 
function ScreenSaverExecute: boolean;
var
Temp : BOOL;
begin
Result := false;
if SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, @Temp, 0) then
if Temp then
Result := Boolean(PostMessage(GetDesktopWindow, WM_SYSCOMMAND,
SC_SCREENSAVE, 0));
end;
 
Back
Top