How to determine that a screensaver is running?

前端 未结 5 2197
暖寄归人
暖寄归人 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:24

    See the WINAPI function SystemParametersInfo() with the SPI_GETSCREENSAVERRUNNING parameter. It's the only documented way to detect whether the screen saver is currently running. (You can also find out if a screen saver is even enabled, get and set the timeout value, and start the screen saver using this function.)

提交回复
热议问题