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!
urifAsked:
Who is Participating?
 
h_mohsenianConnect With a Mentor Commented:
if u run it by shellexecute you can terminate it by TerminateProcess ( API function ) or an API like this.

best regards
hamed
0
 
robert_marquardtCommented:
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.
0
 
urifAuthor Commented:
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?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
DragonSlayerCommented:
how did you run the screensavers?
0
 
urifAuthor Commented:
just by running then as normal exes, shellexecute.
0
 
h_mohsenianCommented:
listening...
0
 
DragonSlayerCommented:
Yup, that was what I was about to say too, Hamed :)

0
 
h_mohsenianCommented:
sorry,DragonSlayer ;-)
0
 
h_mohsenianCommented:
sorry,DragonSlayer ;-)
0
 
DragonSlayerCommented:
Next time... hehehhe :)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.