Computing.Net > Forums > Programming > Updating changes in XP

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Updating changes in XP

Reply to Message Icon

Name: pball
Date: June 8, 2009 at 05:38:10 Pacific
OS: Windows XP
CPU/Ram: 2.8 ghz / 2 gig
Product: Home made / NONE
Subcategory: Batch
Comment:

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.



Sponsored Link
Ads by Google

Response Number 1
Name: Shaka
Date: June 8, 2009 at 23:24:59 Pacific
Reply:

@echo off & setLocal EnableDelayedExpansion
cls
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"
)
popd
%SystemRoot%\System32\RUNDLL32.exe user32.dll, UpdatePerUserSystemParameters
cls
exit


0

Response Number 2
Name: pball
Date: June 9, 2009 at 10:54:39 Pacific
Reply:

...

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.


0

Response Number 3
Name: lucas999
Date: June 10, 2009 at 08:50:50 Pacific
Reply:

You can ask on Professional Win32 api newsgroup :
news://nntp.aioe.org/comp.os.ms-windows.programmer.win32
or
http://groups.google.com/group/comp...
where it has already been discussed
(they have disassembled all apis and then got all parameters..)


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Updating changes in XP

sys reboot XP - batch file www.computing.net/answers/programming/sys-reboot-xp-batch-file/9388.html

printer off in XP use D5 or C ou VB www.computing.net/answers/programming/printer-off-in-xp-use-d5-or-c-ou-vb/7069.html

Update command in VB.NET www.computing.net/answers/programming/update-command-in-vbnet/3989.html