One of the computers I've worked with this week is running Vista and I got
to experience the screen saver problem first hand. I did some
troubleshooting and may have found something.
First, here's a little background information. As you may know, Windows
provides a feature in which a program may disable the screen saver from
starting. This allows, for example, a media player to prevent the screen
saver from starting while the user is watching a video. It does this by
calling SystemParametersInfo() API with uiAction = SPI_SETSCREENSAVEACTIVE
and uiParam = 0 (zero). The program is then supposed to make the same call
with uiParam = 1 later when screen saving is allowed to resume. The
SystemParametersInfo() call ultimately changes the following value in the
registry:
HKEY_CURRENT_USER\Control Panel\Desktop\ScreenSaveActive
To see what was going on, I loaded up Process Monitor
(
www.sysinternals.com) and watched for changes to ScreenSaveActive. Soon
after testing began, I got a hit. Explorer.EXE had changed
ScreenSaveActive to 0. This occurred right after the screen saver had
exited, the second time it had run since I logged in. Then 2 minutes
later, Explorer.EXE set ScreenSaveActive back to 1. 2 minutes happens to
be the amount of time I had set the screen saver timeout to. A little more
testing showed that the amount of time Explorer waits is directly related
to the screen saver timeout setting.
Here are the exact steps I used to reproduce the problem:
- Create a brand new profile (admin level)
- Login to test profile.
- Change screen saver timeout to 2 minutes.
- Logoff from test profile.
- Login to test profile
- Disable welcome center.
- Run Process Explorer (also from
www.sysinternals.com) and verify that no
non-Microsoft DLLs are loaded into the Explorer process. There are none.
- Logoff from test profile.
- Login to test profile.
- Start Process Monitor using a filter that includes only RegSetValue
operations.
- Wait for screen saver to start.
- Move mouse.
- Wait for screen saver to start.
- Move mouse.
- Observe Explorer.EXE set ScreenSaveActive to 0.
- Wait 2 minutes.
- Observe Explorer.EXE set ScreenSaveActive to 1.
It appears that Explorer does not trust the system to properly manage the
screen saver and takes matters into its own hands by manipulating
ScreenSaveActive. I can't see why Explorer feels the need to do this, but
it poses a big problem.
Let's say Explorer sets ScreenSaveActive to 0 and starts a 10 minute wait.
If I log out during this time, the value never gets set back to 1. A
similar situation would occur if Explorer crashes during the wait. Once
the user is logged off and ScreenSaveActive is 0, screen saving won't be
back until another program turns it back on or the user makes a change in
the screen saver CPL applet.
Screen Shots
----------------
Explorer turns screen saving off:
http://img40.imagevenue.com/img.php?image=42141_1_explorer_turns_screen_sav
er_off_122_323lo.jpg
Explorer turns screen saving back on:
http://img17.imagevenue.com/img.php?image=42147_2_explorer_turns_screen_sav
er_on_122_467lo.jpg
The screen saver settings:
http://img134.imagevenue.com/img.php?image=42154_3_screen_saver_settings_12
2_503lo.jpg