Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

stoping screensaver by code

Posted on 2001-07-30
10
Medium Priority
?
198 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
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!

 

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
 
LVL 1

Accepted Solution

by:
h_mohsenian earned 200 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

916 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