Board index » delphi » Turning off a screen saver after it has become active

Turning off a screen saver after it has become active

I need to know how to programmatically turn the screen saver off after it
has become active. I already know how to disable the screen saver so that
it never comes on but this is no good to me. The language I am programming
in is Borland Delphi 3.
        I have already tried to generate a key press via windows API calls but
this does not seem to work. Any help with this problem would be greatly
appreciated.
responses to  jdona...@cccgroup.co.uk.

 

Re:Turning off a screen saver after it has become active


Quote
John Donaldson wrote:

> I need to know how to programmatically turn the screen saver off after it
> has become active. I already know how to disable the screen saver so

   You need to capture the WM_SYSCOMMAND message, and test for the
SC_SCREENSAVE uCmdType. See the win32 api help on WM_SYSCOMMAND.

--
Marko Peric     lonew...@tig.com.au

Re:Turning off a screen saver after it has become active


John,
   You might benefit from checking out the example on my page about turning
off screensavers.
                                Good Luck!!
         Dave
      http://www.erols.com/dparsons

Quote
John Donaldson wrote in message <01bd6d1c$6df64590$d20170c1@donaldsonnt>...
>I need to know how to programmatically turn the screen saver off after it
>has become active. I already know how to disable the screen saver so that
>it never comes on but this is no good to me. The language I am programming
>in is Borland Delphi 3.
> I have already tried to generate a key press via windows API calls but
>this does not seem to work. Any help with this problem would be greatly
>appreciated.
>responses to  jdona...@cccgroup.co.uk.

Re:Turning off a screen saver after it has become active


Quote
In article <01bd6d1c$6df64590$d20170c1@donaldsonnt>, "John Donaldson" <jdona...@cccgroup.co.uk> wrote:
>I need to know how to programmatically turn the screen saver off after it
>has become active. I already know how to disable the screen saver so that
>it never comes on but this is no good to me. The language I am programming
>in is Borland Delphi 3.
>        I have already tried to generate a key press via windows API calls but
>this does not seem to work. Any help with this problem would be greatly
>appreciated.

How about finding out from registry the name of the SCR and then
(OpenProcess() and) TerminateProcess() ?

- Sten

Other Threads