Disable the screensaver while your application is executing  

Send By: Q3 Team
Web : http://www.q3.nu
Email: dlib@q3.nu
Date: 20/07/99

Tip accessed 524 times

 


We will capture and will treat the wm_syscommand message

  • Add this line in the private of your form:


          procedure appmessage(var msg:tmsg;var handled:boolean);
    



  • Add this code to the OnCreate event of the form:


          procedure tform1.formcreate(sender:tobject);
          begin;
            application.onmessage:=appmessage;
          end;
    



  • And to finish... add this procedure in the implementation of the form:


          procedure tform1.appmessage(var msg:tmsg; var handled:boolean);
          begin
            if (msg.message=wm_syscommand) and (msg.wparam=sc_screensave)
            then handled:=true;
          end;