I'm working on code that's supposed to start the screensaver defined by the user preferences. (The code is in Java, but will only be run under Windows.) My current approach is to set the ScreenSaveTimeOut value in the registry to 1; in theory, that should kick the screensaver on after a delay of merely one second.
But in practice, it does no such thing. I've hit the values in both HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveTimeOut and HKEY_USERS.DEFAULT\Control Panel\Desktop\ScreenSaveTimeOut with no results. I can see the values change when I fire up regedit, but the "Wait" value in Display Properties -> Screen Saver doesn't change.
An Experts-Exchange thread indicated I ought to do this to make the changes effective immediately:
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters
... but that didn't seem to do anything.
Any advice or insights into what I'm doing wrong?