Solved

stoping screensaver by code

Posted on 2001-07-30
10
190 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
Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Printing problem 2 102
Why is there a Difference between the SQL String and using the Parameter ? 7 45
CheckListBox usage 3 71
Microsoft Access 97 and Delphi XE2 9 56
A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

830 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