I've got a script that will set the wallpaper to an ActiveDesktop, HTML
based wallpaper. I can set the wallaper, but without a reboot or
opening the desktop properties and toggling the wallpaper choice, the
settings don't apply immediately. If there a way to refresh the desktop
or force a refresh programatically, and without having to pop up the
desktop proeprties window?

Here's my scritpt as it stands right now:

'~~~~~~~~~~~~~~ BEGIN CODE
' Set the wallpaper path
WP = "%SystemRoot%\Web\Wallpaper\ActiveWallpaper.html"

' Edit the registry to set the wallpaper choice
Set objShell = CreateObject("WScript.Shell")
objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaper", ""
objShell.Regwrite "HKCU\Control Panel\Desktop\TileWallPaper", 0
objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaperStyle", 0
objShell.Regwrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\WallPaper", ""
objShell.Regwrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\TileWallPaper", 0
objShell.Regwrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\WallPaperStyle", 0

objShell.Regwrite "HKCU\Software\Microsoft\Internet
Explorer\Desktop\General\WallPaper", WP
objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaper", WP

' Open the Desktop Properties window and toggle/apply to force the
desktop
objShell.Run "control desk.cpl"
WScript.Sleep 300
objShell.AppActivate "Themes"
WScript.Sleep 300
objShell.SendKeys "{tab}"
WScript.Sleep 300
objShell.SendKeys "{tab}"
WScript.Sleep 300
objShell.SendKeys "~"
Set objShell = nothing
'~~~~~~~~~~~~~~ END CODE

Obviously, I'd like to apply the wallpaper without rebooting or having
to mess with the desktop properties window. Any help would be greatly
appreciated!

Re: Setting HTML based wallpaper? by Steven

Steven
Thu Aug 10 11:30:50 CDT 2006

Have you tried to kill explorer.exe and restart it?

-Steven-
"Nebulus" <pfriedl@gmail.com> wrote in message
news:1155224799.573632.139320@i42g2000cwa.googlegroups.com...
> I've got a script that will set the wallpaper to an ActiveDesktop, HTML
> based wallpaper. I can set the wallaper, but without a reboot or
> opening the desktop properties and toggling the wallpaper choice, the
> settings don't apply immediately. If there a way to refresh the desktop
> or force a refresh programatically, and without having to pop up the
> desktop proeprties window?
>
> Here's my scritpt as it stands right now:
>
> '~~~~~~~~~~~~~~ BEGIN CODE
> ' Set the wallpaper path
> WP = "%SystemRoot%\Web\Wallpaper\ActiveWallpaper.html"
>
> ' Edit the registry to set the wallpaper choice
> Set objShell = CreateObject("WScript.Shell")
> objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaper", ""
> objShell.Regwrite "HKCU\Control Panel\Desktop\TileWallPaper", 0
> objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaperStyle", 0
> objShell.Regwrite "HKCU\Software\Microsoft\Internet
> Explorer\Desktop\General\WallPaper", ""
> objShell.Regwrite "HKCU\Software\Microsoft\Internet
> Explorer\Desktop\General\TileWallPaper", 0
> objShell.Regwrite "HKCU\Software\Microsoft\Internet
> Explorer\Desktop\General\WallPaperStyle", 0
>
> objShell.Regwrite "HKCU\Software\Microsoft\Internet
> Explorer\Desktop\General\WallPaper", WP
> objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaper", WP
>
> ' Open the Desktop Properties window and toggle/apply to force the
> desktop
> objShell.Run "control desk.cpl"
> WScript.Sleep 300
> objShell.AppActivate "Themes"
> WScript.Sleep 300
> objShell.SendKeys "{tab}"
> WScript.Sleep 300
> objShell.SendKeys "{tab}"
> WScript.Sleep 300
> objShell.SendKeys "~"
> Set objShell = nothing
> '~~~~~~~~~~~~~~ END CODE
>
> Obviously, I'd like to apply the wallpaper without rebooting or having
> to mess with the desktop properties window. Any help would be greatly
> appreciated!
>



Re: Setting HTML based wallpaper? by Nebulus

Nebulus
Thu Aug 10 12:23:12 CDT 2006

Well, I could but I'd rather not do something that drastic.

Steven Platt wrote:
> Have you tried to kill explorer.exe and restart it?


Re: Setting HTML based wallpaper? by Babu

Babu
Thu Aug 10 12:23:54 CDT 2006

no... you have to run a RUNDLL command.... i forget how to do it

:(


"Steven Platt" <me@nowhere.com> wrote in message
news:%238HrvoJvGHA.4876@TK2MSFTNGP04.phx.gbl...
> Have you tried to kill explorer.exe and restart it?
>
> -Steven-
> "Nebulus" <pfriedl@gmail.com> wrote in message
> news:1155224799.573632.139320@i42g2000cwa.googlegroups.com...
>> I've got a script that will set the wallpaper to an ActiveDesktop, HTML
>> based wallpaper. I can set the wallaper, but without a reboot or
>> opening the desktop properties and toggling the wallpaper choice, the
>> settings don't apply immediately. If there a way to refresh the desktop
>> or force a refresh programatically, and without having to pop up the
>> desktop proeprties window?
>>
>> Here's my scritpt as it stands right now:
>>
>> '~~~~~~~~~~~~~~ BEGIN CODE
>> ' Set the wallpaper path
>> WP = "%SystemRoot%\Web\Wallpaper\ActiveWallpaper.html"
>>
>> ' Edit the registry to set the wallpaper choice
>> Set objShell = CreateObject("WScript.Shell")
>> objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaper", ""
>> objShell.Regwrite "HKCU\Control Panel\Desktop\TileWallPaper", 0
>> objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaperStyle", 0
>> objShell.Regwrite "HKCU\Software\Microsoft\Internet
>> Explorer\Desktop\General\WallPaper", ""
>> objShell.Regwrite "HKCU\Software\Microsoft\Internet
>> Explorer\Desktop\General\TileWallPaper", 0
>> objShell.Regwrite "HKCU\Software\Microsoft\Internet
>> Explorer\Desktop\General\WallPaperStyle", 0
>>
>> objShell.Regwrite "HKCU\Software\Microsoft\Internet
>> Explorer\Desktop\General\WallPaper", WP
>> objShell.Regwrite "HKCU\Control Panel\Desktop\WallPaper", WP
>>
>> ' Open the Desktop Properties window and toggle/apply to force the
>> desktop
>> objShell.Run "control desk.cpl"
>> WScript.Sleep 300
>> objShell.AppActivate "Themes"
>> WScript.Sleep 300
>> objShell.SendKeys "{tab}"
>> WScript.Sleep 300
>> objShell.SendKeys "{tab}"
>> WScript.Sleep 300
>> objShell.SendKeys "~"
>> Set objShell = nothing
>> '~~~~~~~~~~~~~~ END CODE
>>
>> Obviously, I'd like to apply the wallpaper without rebooting or having
>> to mess with the desktop properties window. Any help would be greatly
>> appreciated!
>>
>
>



Re: Setting HTML based wallpaper? by D

D
Thu Aug 10 14:33:04 CDT 2006

Hi Nebulus,
You could try:

Dim lo_wsh
Set lo_wsh = CreateObject( "WScript.Shell" )
lo_wsh.Run "%windir%\System32\RUNDLL32.EXE user32.dll,
UpdatePerUserSystemParameters", 1, False

Regards,
Dave.



Re: Setting HTML based wallpaper? by Nebulus

Nebulus
Thu Aug 10 16:06:18 CDT 2006

Dave,
thanks for the tip./ I did see the desktop refresh, but the HTML
wallpaper doesn't show up after the refresh. Is there something with
the iActiveDesktop interface the can be used?

> You could try:
> Dim lo_wsh
> Set lo_wsh = CreateObject( "WScript.Shell" )
> lo_wsh.Run "%windir%\System32\RUNDLL32.EXE user32.dll,
> UpdatePerUserSystemParameters", 1, False
>
> Regards,
> Dave.


Re: Setting HTML based wallpaper? by D

D
Fri Aug 11 01:33:11 CDT 2006

Hi Nebulus,
I'm sorry, but I don't know. Maybe someone else will post an answer.
Regards,
Dave.