Dave Niemeyer said:
Thanks for the info, Eric, but I'm not sure I follow.
How can I send a "Windows settings change message" and do so in a script
included in a group policy and "wrap the proper API calls." If this is a
very loaded question, please direct me where to investigate, thanks.
A script is a script, no matter that it runs in a GPO. I didn't elaborate
on posting messages using Windows APIs in VBScript, because if you knew how
to do it I wouldn't have to, and if you didn't I don't have the ability to
describe it to you in enough detail to make it work. However, since you
asked, this is the call as it is done in C++:
PostMessage(
HWND_BROADCAST,
WM_SETTINGCHANGE,
FALSE,
(lParam)_T("Windows") )
and this is a bit on it from MSDN:
WM_SETTINGCHANGE
==================
The system sends the WM_SETTINGCHANGE message to all top-level windows when
the SystemParametersInfo function changes a system-wide setting or when
policy settings have changed.
Applications should send WM_SETTINGCHANGE to all top-level windows when they
make changes to system parameters. (This message cannot be sent directly to
a window.) To send the WM_SETTINGCHANGE message to all top-level windows,
use the SendMessageTimeout function with the hwnd parameter set to
HWND_BROADCAST.
==================
I know you can call this API directly from VB by using the proper function
prototype, but I don't know about VB Script. This is what I meant by
"wrapping" the API.
Again, I can't say for sure that this message will force the desktop to
update once loaded, but if not it's unlikely anything else would except for
an explorer restart.
However the first thing you should do is try your *existing* script in a
synchronous GPO/logon script. Since the script will run before the
wallpaper is loaded, it would normally not have problem with refresh. And
since a restart solves your problem, this should as well. Since wallpaper
is a user profile item, I'd expect a logoff/logon to reset it - are you sure
it takes a full restart?
I've only tried that script, seen below, manually so far, not included it as
a parameter in any GPO.
Hook it into logon script policy.
And I haven't seen how to accomplish my goal in
Group Policy without enabling Active Desktop which I think I'll have to
avoid since we "hide all desktop items" which includes the Active wallpaper.
If anyone can tell me how the Active desktop wallpaper can be seen yet hide
all items on the desktop, like all the icons, I'd be glad to know how. A
wallpaper isn't hidden if we don't use Active desktop but hide all desktop
items as far as I can see using Group Policy.
I don't know about the specific wallpaper policies, but it sounds like you
are talking about ADM templates. That is different than what you are trying
to do above, and if what you are doing works - short of a reboot - then you
should be able to make it work the way you want by just running it at logon.
Regards,
Eric