• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

Stop screen saver.

How to stop a started screen saver?
If the screen saver is password protected, how to stop it?
  • 3
  • 2
  • 2
1 Solution
unit Unit1;


   Windows, Messages, SysUtils, Classes,
   Graphics, Controls, Forms, Dialogs;

   TForm1 = class(TForm)
     procedure WMSysCommand(var Msg : TWMSysCommand);
               message WM_SYSCOMMAND;
     { Public declarations }

   Form1: TForm1;


 {$R *.DFM}

 procedure TForm1.WMSysCommand(var Msg : TWMSysCommand);
   //trap the message and set its result to -1
   if (Msg.CmdType = SC_SCREENSAVE) then
     Msg.Result := -1


P.S sorry for making this an Answer but i am fed up with people putting answers as comments and taking the points for it, until EE has changed this, i will continue to do this.....  

That code will stop a Screen saver from running, and i'm sure theres a pwl file you can delete to stop the password from working...

Craig C.
oops that should be answers as comments.... where i have put the answer in a comment, but they decide putting there own version of thier code as an answer and the user ignores what i put..... now that i dont like....
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Not had a good day Craig?


nytAuthor Commented:
I DO accept comments as answer if the comment really works.  Instead of storing in a pwl file, I've heard that the password of the screen saver is stored in the registry.

Your "answer" works well......  ;-)
tim, no.... but, may i ask one question?... Tim what exacty was your answer? you were getting points for nothing all than using the search function.... Good idea.... juts post back what the search gives me, and i get the points :) he spent points to give points.... i am not saying this is wrong, but i have to wonder whats going on here.....
nytAuthor Commented:
That's why only a "C" is given to him.  (The lowest grade of "Accept comment as answer)
If he/she submitted it as answers, I would give "D" even.
Anyway, Craig,  thanks for your help.

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now