Solved

stoping screensaver by code

Posted on 2001-07-30
10
186 Views
Last Modified: 2010-04-06
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!
0
Comment
Question by:urif
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 11

Expert Comment

by:robert_marquardt
ID: 6333786
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
 

Author Comment

by:urif
ID: 6333802
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
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6333851
how did you run the screensavers?
0
 

Author Comment

by:urif
ID: 6333908
just by running then as normal exes, shellexecute.
0
 
LVL 1

Expert Comment

by:h_mohsenian
ID: 6334549
listening...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 1

Accepted Solution

by:
h_mohsenian earned 50 total points
ID: 6334580
if u run it by shellexecute you can terminate it by TerminateProcess ( API function ) or an API like this.

best regards
hamed
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6336358
Yup, that was what I was about to say too, Hamed :)

0
 
LVL 1

Expert Comment

by:h_mohsenian
ID: 6336710
sorry,DragonSlayer ;-)
0
 
LVL 1

Expert Comment

by:h_mohsenian
ID: 6336713
sorry,DragonSlayer ;-)
0
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6339772
Next time... hehehhe :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now