2
votes

I'd like to determine when the computer stops displaying the screensaver. I don't mean when the users' desktop is displayed as there's sometimes a lock screen in between the 2 events.

As a little background, I've got an alarm application. I'd like to be able to silence the alarm by moving the mouse or pressing any key.

With no password on resume, this is easy. However, with a lock screen, my app doesn't begin to receive inputs until after the user has entered a password - which means there's an alarm blaring out while they're trying to log in.

Is there any way to detect when the lock screen desktop is displayed and handle this scenario? I know that interaction across desktops is severely limited, but is detection of possible (or does it get created at the same time as the screensaver is displayed, in which case, I'm trying for the wrong approach)?

I'd appreciate it if someone could point me at a good tutorial/article or share any experience with this.

1

1 Answers

0
votes

You could poll the list of running processes, and check whether the process name of any of the processes ends with .scr - If a .scr exists in the list, then the screensaver is running. If the last time you checked there was one, and now there's not - the screensaver has stopped.