How to tell if screensaver is temporarily disabled?

419 Views Asked by At

Say, when a YouTube video is played via Google Chrome browser, or any video/sound in a Windows Media Player, both temporarily disable a screensaver if one is set up in a user's control panel. This happens only for the duration of the video being played or until the playback is paused.

Is there any way to know that screensaver (and power saving) was disabled in such a situation?

PS. I'm coding with C++.

1

There are 1 best solutions below

5
On

There is a registry value that will disable the screensaverUser.

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

Its name is: ScreenSaveActive

The key type is: REG_DWORD (DWORD Value)

To disable screen saver set the value to 0, when your application is done set it back to 1

If the key is not there just create one. To edit the registry through C++ there are a few steps.

Hope this helps