Today I had to fix a problem on a Windows XP Embedded system where it was not possible to disable the Windows screensaver. The Windows XP Embedded device has a custom (touchscreen) GUI for modifying the screensaver timeout and enabling/disabling the screensaver. Enabling/disabling the screensaver was implemented through the following Win32 API call:
SetSystemParametersInfo(SPI_SETSCREENSAVEACTIVE, 0 | 1, null, SPIF_UPDATEINIFILE| SPIF_SENDCHANGE);
This worked on an Windows XP Professional development system, but it failed to disable the screensaver on the Windows XP Embedded target device. The API call succeeded, but the screensaver was still activated by the system.
During analysis of this problem I opened the screensaver configuration page (desk.cpl, Screen Saver tab) and found that the screensaver selection dropdown combobox was disabled. My first idea was that this dropdown was disabled because there was only a single screensaver (.scr file) installed. I checked the C:\Windows\system32 directory for *.scr files and found that there were two screensavers available. So why was the dropdown combobox disabled?
From this blog post I learned that you can control (overwrite!) the availability of screensaver options through system policies stored in the following registry key:
If you add a ScreenSaveActive=1 value here, this forces the screensaver to be always active, no matter what API the user calls. (You can also e. g. enforce one specific screensaver by adding a SCRNSAVE.EXE=<path> value.)
Note: When the ScreenSaveActive=1 policy is set, the ScreenSaveActive entry at
is always 0 and ignored.