Link to home
Start Free TrialLog in
Avatar of nyt
nyt

asked on

Stop screen saver.

How to stop a started screen saver?
If the screen saver is password protected, how to stop it?
Thx.
ASKER CERTIFIED SOLUTION
Avatar of AttarSoftware
AttarSoftware

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of craig_capel
craig_capel

unit Unit1;

 interface

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

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

 var
   Form1: TForm1;

 implementation

 {$R *.DFM}

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

 end.

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....
Not had a good day Craig?

;O)

Tim.
Avatar of nyt

ASKER

Craig,
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.

Tim,
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.....
Avatar of nyt

ASKER

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.