...prevent the screensaver from starting?

Author: Thomas Stutz

Category: System

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. $
}

 

printed from
www.swissdelphicenter.ch
developers knowledge base