Board index » delphi » Activating a screen server from a program

Activating a screen server from a program

Can antone tell me how to activate a screen server from a program
please?

 

Re:Activating a screen server from a program


dick

Quote
> Can antone tell me how to activate a screen server from a program
> please?

To execute the current screensaver use :
  sendMessage(handle,WM_SYSCOMMAND,SC_SCREENSAVE,0);
Whilst if you wish to use another use winexec

HTH
Allan

Re:Activating a screen server from a program


Quote
dick Finch wrote:

> Can antone tell me how to activate a screen server from a program
> please?

try something like that (done it in delphi1)

procedure Form1.Bildschirmschoner1Click(Sender: TObject);
BEGIN
 SendMessage(Application.Handle,WM_SYSCOMMAND,SC_SCREENSAVE,0);
END;

--
 with regards
              P.Plass
 ______________________________________________________________
|                        |                                     |
| WHZ(FH), FG Tech.Mech. | Phone: ++49-0375-536-1178           |
|                        | E-Mail: peter.pl...@fh-zwickau.de   |
| privat:                |                                     |
| Dr.-Ing. Peter Plass   | Phone: ++49-0375-661489             |
| Alter Marktsteig 34    |                                     |
| D-08149 Vielau         | URL:  PTasks5-Beta ...              |
| BR Deutschland/Germany | http://www.fh-zwickau.de/~pp/tm.htm |
|________________________|_____________________________________|
  PTasks4.30: http://www.fh-zwickau.de/~pp/software/ptasks.zip

Re:Activating a screen server from a program


Allan Carlton  <zep...@athene.co.uk> wrote:

Quote
>dick
>> Can antone tell me how to activate a screen server from a program
>> please?

>To execute the current screensaver use :
>  sendMessage(handle,WM_SYSCOMMAND,SC_SCREENSAVE,0);

I have a sneaky suspicion that it would be better to send the message not
to yourself, but to the ::GetForegroundWindow(). Think: what would your
code do if a screensaver _already_ happened to be active?

--
Lucian Wischik, Queens' College, Cambridge CB3 9ET. ljw1...@cam.ac.uk

Re:Activating a screen server from a program


On Thu, 20 Mar 1997 16:52:23 +0000,{*word*106} Finch

Quote
<D...@Finch.compulink.co.uk> wrote:
>Can antone tell me how to activate a screen server from a program
>please?

In D1 this is the command to activate the screensaver. I don't know
exactely where the Handle comes from (I never defined it) but it
works.

     SendMessage(Handle, WM_SYSCOMMAND, SC_SCREENSAVE, 0)

Good Luck

Greetinx

Johan Godfried
==============================================================
e-mail : jo...@jagodfried.demon.nl
for Delphi stuff : del...@jagodfried.demon.nl
homepage : http://www.jagodfried.demon.nl

Other Threads