Google
 

Monday, February 18, 2008

Disable Screensaver

{Insert the following code into the
"public" section of
your main form:}


procedure AppMessage(var Msg : TMsg;var bHandled : boolean ) ;
{In the OnCreate for the main form add:}
Application.OnMessage := AppMessage;
{In the "implementation" section, insert the
following code (suppose Form1 is the name of your form):}

procedure TForm1.AppMessage(var Msg : TMsg;
___var bHandled : boolean ) ;
begin
___if((WM_SYSCOMMAND = Msg.Message) and
___
___(SC_SCREENSAVE = Msg.wParam) )then
______bHandled := True;
end;



No comments: