Screen Saver Refresh

D

Don

I need to change the screensaver settings on 500 thin terminals running
windows xp embedded. I am attempting to do this via a login script
which imports the following registry keys:

[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\Control
Panel\Desktop]

"ScreenSaverIsSecure"="1"
"ScreenSaveTimeOut"="300"
"ScreenSaveActive"="1"
"SCRNSAVE.EXE"="C:\\WINDOWS\\System32\\logon.scr"

The import is successful, but the screen saver doesn't work unless you
do one of the following:

1. from the display applet in the control panel, goto the screensaver
tab. The settings are grayed out, but they are correct so i know the
import was successful. If i click cancel, it still won't work, if I
click OK without changing anything, it will start working.

2. Log off and log back on and it will start working. Once the
terminal is rebooted, it's back to the beginning as all changes are
wiped out on reboot.

I need to know if anyone is aware of a way to refresh the screensaver
settings from a script after the reg keys are imported.

Thanks...
 
K

KM

I always thought those registry settings need to be imported under [HKEY_CURRENT_USER\Control Panel\Desktop] key.
Or under [HKEY_USERS\DEFAULT\SOFTWARE\CONTROL PANEL\DESKTOP] to affect all users.
 
D

Don

KM said:
I always thought those registry settings need to be imported under [HKEY_CURRENT_USER\Control Panel\Desktop] key.
Or under [HKEY_USERS\DEFAULT\SOFTWARE\CONTROL PANEL\DESKTOP] to affect all users.
Actually they can go under those, or the ones I'm importing. The
difference being that the key's I'm using are read as policies and
therefore will override any others and at the same time prevent the user
from changing them.

To my original post, the problem is the screensaver is initiated prior
to the script running. I need to know what service / process initiates
the screensaver and if I can re-initiate within the script.

Ideas? Anyone?
 
D

Dave R.

Or under [HKEY_USERS\DEFAULT\SOFTWARE\CONTROL PANEL\DESKTOP] to affect
all users.

Did you mean the .DEFAULT user by any chance?

If not, and you really meant DEFAULT without the dot, that key doesn't
exist for me. Is there a way to make it exist?

If you did mean .DEFAULT, that isn't the All Users user / key, that is
the System user (IOW, the user in effect when no one is currently logged
in, and the context that System services run).

As far as I can tell, there isn't an All User key in the way you appear
to mean it. If I load %allusersprofile%\NTUser.dat and modify it, that
affects all new users, but not any users that already exist.

Or am I missing something?

Regards,

Dave
 
D

Don

The policy key affects all users whether new or existing
Or under [HKEY_USERS\DEFAULT\SOFTWARE\CONTROL PANEL\DESKTOP] to affect
all users.

Did you mean the .DEFAULT user by any chance?

If not, and you really meant DEFAULT without the dot, that key doesn't
exist for me. Is there a way to make it exist?

If you did mean .DEFAULT, that isn't the All Users user / key, that is
the System user (IOW, the user in effect when no one is currently logged
in, and the context that System services run).

As far as I can tell, there isn't an All User key in the way you appear
to mean it. If I load %allusersprofile%\NTUser.dat and modify it, that
affects all new users, but not any users that already exist.

Or am I missing something?

Regards,

Dave
 
D

Dave R.

Don said:
Dave said:
Or under [HKEY_USERS\DEFAULT\SOFTWARE\CONTROL PANEL\DESKTOP] to
affect all users.

Did you mean the .DEFAULT user by any chance?

If not, and you really meant DEFAULT without the dot, that key
doesn't exist for me. Is there a way to make it exist?

If you did mean .DEFAULT, that isn't the All Users user / key, that
is the System user (IOW, the user in effect when no one is currently
logged in, and the context that System services run).

As far as I can tell, there isn't an All User key in the way you
appear to mean it. If I load %allusersprofile%\NTUser.dat and modify
it, that affects all new users, but not any users that already exist.

Or am I missing something?
The policy key affects all users whether new or existing

Understood. However, I was replying to KM to try to understand his
reply to you.

Regards,

Dave
 
K

KM

Dave,

Yes, I meant the .DEFAULT branch. Sorry for the typo.

If you had a setting populated in the default user branch before FBA, it would apply to all users since their profiles are created
during FBA.

--
=========
Regards,
KM
KM said:
Or under [HKEY_USERS\DEFAULT\SOFTWARE\CONTROL PANEL\DESKTOP] to affect all users.

Did you mean the .DEFAULT user by any chance?

If not, and you really meant DEFAULT without the dot, that key doesn't exist for me. Is there a way to make it exist?

If you did mean .DEFAULT, that isn't the All Users user / key, that is the System user (IOW, the user in effect when no one is
currently logged in, and the context that System services run).

As far as I can tell, there isn't an All User key in the way you appear to mean it. If I load %allusersprofile%\NTUser.dat and
modify it, that affects all new users, but not any users that already exist.

Or am I missing something?

Regards,

Dave
 
D

Don

Correct, but my only option for importing the registry is via a login
script. The script doesn't run until after the user logs on and the
default screen saver settings are initialized. Even if I could populate
the default registry from this script, it wouldn't take effect until
after a reboot which wipes out all changes because of the write filter
running in the embedded OS.

Back to my original post, is there a way to re-initialize the
screensaver after the login script runs. It's my understanding this is
done through a function of the user32.dll
 
K

KM

Understood. Your issue is that you have to do that dynamically (no logoff or reboot) but just want to implement it via the
reg.import.

Have you thought of calling SystemParametersInfo(SPI_SETSCREENSAVEACTIVE) API? That will update the screensaver status and properly
broadcast the message to all running apps including the shell itself.
Also, you can change the screensaver with the same code if you call SystemParametersInfo( SPI_GETSCREENSAVETIMEOUT ). Please add
SPIF_UPDATEINIFILE flag to the call.

Another way to fix the issue could be in populating the correct reg entries, open up the GUI (CPL) and click OK button there. To
automate the latter and to open up the Display CPL on Screensaver page you can run "control.exe DESK.CPL,,1" command line. You can
then "click" the OK button there with a simple little app that find the dialog and makes the EndDialog(IDOK) call.

Want to see some sample code? take a look at this article: http://www.codeguru.com/cpp/misc/misc/screensavers/article.php/c419.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top