Updating changes in XP

Home made / NONE
June 8, 2009 at 05:38:10
Specs: Windows XP, 2.8 ghz / 2 gig
I finally found a simple way to change the wallpaper via a script. But the last line which calls a dll and is supposed to update the changes does not. Thus the wallpaper is "changed" but the changes won't show until I log out, shut down, or some times refresh the desktop.

REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "c:\WINDOWS\Blue Lace 16.bmp"

REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D 0

REG ADD "HKCU\Control Panel\Desktop" /V TileWallpaper /T REG_SZ /F /D 2

RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters 

I'm running XP SP3 and I'm wondering if that dll call still works, since most of the posts I found it in are older.

Also would anyone know the values needed for stretched and centered? Since that is tiled now.

See More: Updating changes in XP

Report •

June 8, 2009 at 23:24:59
@echo off & setLocal EnableDelayedExpansion
REG ADD "HKCU\Control Panel\Desktop" /V WallpaperStyle /T REG_SZ /F /D 2
pushd "%userprofile%\My Documents\My Pictures"
FOR /F "tokens=1 delims= " %%A IN ('DIR *.bmp ^| FIND /c /v ""') DO SET var=%%A
set /a z=%random%%%var+1
for /f "tokens=* delims= " %%a in ('dir /b "%userprofile%\My Documents\My Pictures\*.bmp"') do (
set /a N+=1
if !z! equ !N! REG ADD "HKCU\Control Panel\Desktop" /V Wallpaper /T REG_SZ /F /D "%userprofile%\My Documents\My Pictures\%%a"
%SystemRoot%\System32\RUNDLL32.EXE user32.dll, UpdatePerUserSystemParameters

Report •

June 9, 2009 at 10:54:39

um from what I see that is supposed to find a bmp in the document and setting folder then set it to be the wallpaper. Which doesn't even begin to answer my question at all. I know how to set the wallpaper using the registry now but it won't update the desktop when I do so.

Report •

June 10, 2009 at 08:50:50
You can ask on Professional Win32 api newsgroup :
where it has already been discussed
(they have disassembled all apis and then got all parameters..)

Report •

Related Solutions

Ask Question