Solved

stoping screensaver by code

Posted on 2001-07-30
10
189 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

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…
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…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 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

10 Experts available now in Live!

Get 1:1 Help Now