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++.
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.
Open the registry : RegOpenKeyEx
Query the value : RegQueryValueEx
/* do something with value*/
Set the value back : RegSetValueEx
close the registry : RegCloseKey
Hope this helps