function IsScreenSaverActive: Boolean;
begin
  SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, @Result, 0);
end;

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of John Bird

So what is the best way to detect the screensaver is on?  The best way I
know so far is

P:array[0..256] of Char;
Title:string;
ScreenSaverOn:Boolean:
..

  GetWindowText(GetActiveWindow,p,256);
  title:=p;
  if title='' then ScreenSaverOn:=true;

Which is sort of indirect - the screensaver is the only window with a
blank title text.  It is possible to detect if the mouse and keyboard
are idle, but that does not mean the screensaver has come on of course.

Is there anything more direct to detect the screensaver?

_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe

Reply via email to