How to determine that a screensaver is running?

前端 未结 5 2034
暖寄归人
暖寄归人 2021-01-13 22:08

One solution that one could suggest is to periodically look for a special \'Screen-saver\' desktop, and if it\'s present then count it as a running screensaver.

But

5条回答
  •  别那么骄傲
    2021-01-13 22:23

    This is my implementation of screen saver event detection.

    Notes:

    • SPI_GETSCREENSAVERRUNNING detects Windows Event id 4802 and 4803 which weren't accurate in my case, see my problem hence user idle time calculation is added
    • GetLastInputInfo apparently doesn't work if process is a service.

提交回复
热议问题