How do I know if the screen saver is temporarily disabled?

For example, when a YouTube video is played through the Google Chrome browser or any video / sound in Windows Media Player, both temporarily turn off the screen saver if it is configured in the user’s control panel. This only happens for the duration of the video playback or until playback is paused.

Is there a way to find out that the screensaver (and power saving) was turned off in such a situation?

PS. I am coding with C ++.

+4
source share
1 answer

There is a registry value that will disable screenscreener.

The key is located at: HKEY_CURRENT_USER \ Software \ Policies \ Microsoft \ Windows \ Control Panel \ Desktop

His name: ScreenSaveActive

Key Type: REG_DWORD (DWORD Value)

To turn off the screen saver, set the value to 0, when your application is completed, set it to 1

If the key is missing, just create it. To edit the registry via C ++, follow a few steps.

Hope this helps

-one
source

Source: https://habr.com/ru/post/1494233/


All Articles