How to detect if the Screen Saver is running

I have a b/g app that I wrote in Delphi 3 that logs system info when the user
is active.  I want to suspend the logging when the user is IDLE.

I have tried to trap the WM_IDLE message but because the application is never
active (it runs in the b/g with no form) that message will always appear. So
I figure I would check to see if the screensaver is running - if it is set a
flag - if its not - dont set it. I did a lot of experimenting with
SystemParametersInfo using SPI_SCREENSAVERRUNNING - But I was never able to
detect if it is actually running or not, the call I used was :

srunning=0;
SystemParametersInfo(SPI_SCREENSAVERRUNNING,srunning,&dummy,0);
if srunning=0 then
  SSFLAG := FALSE
else
  SSFLAG := TRUE;

It would always return FALSE - no matter what.

Does anyone have any idea how to either :

1 - detect if the Screen saver is currently running?

and/or

2 - detect idle time from a b/g program?

Any ideas would be VERY helpful.

Thanks

_Rob

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum