Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : Screen saver detect montor off

www.cryer.info
Managed Newsgroup Archive

Screen saver detect montor off

Subject:Screen saver detect montor off
Posted by:"Thorsten Dittmar" (nospam@dithosoft.de)
Date:Sat, 12 Mar 2005 11:10:56

Hi,

I've written a screen saver that does its work in a thread (simply
magnifies the screen by a certain factor and scrolls it).

The thread code looks as follows:

// As long as the screen saver is running, create new images
sleeptime := 1000-(90 * FSpeed);
while not Terminated do
begin
   PrepareStep;
   PrepareClip;
   Synchronize(DoOnNewFrame);
   Sleep(sleeptime);
end;

This works nicely, but my system seems to have problems going to sleep
if I don't work for a long time. I assume this is due to my screen saver
consuming lots of CPU time.

The monitor is powered off after some time, but the screen saver seems
to keep running and consuming CPU time.

Now, I want to try what happens if I pause my thread as soon as the
monitor is powered off after the specified time. However, I cannot find
a way to get notified about this.

Is there a message that I can intercept or a function I can call to
check or get notified about the fact that the monitor power is turned
off after the time I specify in my energy settings?

Regards
Thorsten


--
Please don't reply to this message via eMail. Your message will not
be read. Thank you for not sending spam!

Replies:

www.cryer.info
Managed Newsgroup Archive