Link to home
Start Free TrialLog in
Avatar of urif
urif

asked on

stoping screensaver by code

Hi,

i need (if possible) a way (maybe an api call?) to stop the running screensaver and then run another totally different screen saver. what i mean is i would like to finish or terminate the current screensaver and run another with out having to set it as the default screensaver (passing scr_name parameters?)


any ideas?

thakns!
Avatar of robert_marquardt
robert_marquardt

Assuming that the running screen saver does not ask for password etc you should be able to simply post a key.
Use keybd_event() to post a Shift key down and Shift key up.

Starting the new screen saver should work by simply executing it like any other exe.
Avatar of urif

ASKER

that's the thing, i did this before (the key down/up message) but then th OS welcomed me with a "enter the password" dialog...

now i solved this by disabling momentarily the password in the registry and then enabling it again (if it was enabled) but then somehow both screensavers ran at the same time and they overlapped!

any ideas?
how did you run the screensavers?
Avatar of urif

ASKER

just by running then as normal exes, shellexecute.
listening...
ASKER CERTIFIED SOLUTION
Avatar of h_mohsenian
h_mohsenian

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
Yup, that was what I was about to say too, Hamed :)

sorry,DragonSlayer ;-)
sorry,DragonSlayer ;-)
Next time... hehehhe :)