Mega Code Archive

 
Categories / Delphi / System
 

Prevent the screensaver from starting

Title: prevent the screensaver from starting? interface private procedure AppMessage(var Msg: TMsg; var handled: Boolean); end; implementation procedure TForm1.AppMessage(var Msg: TMsg; var handled: Boolean); begin if (Msg.Message = WM_SYSCOMMAND) and (Msg.wParam = SC_SCREENSAVE) then Handled := True; end; procedure TForm1.FormCreate(Sender: TObject); begin Application.OnMessage := AppMessage; end; { Note: The Screensaver is only disabled during the lifespan of your application. Bemerkung: Der Screensaver bleibt nur solange deaktiviert, wie ihre Applikation l uft. $ }