Archive: theme and wallpaper manipulation


theme and wallpaper manipulation
ive made an installer for a theme & wallpaper. is it possible to check whether the wallpaper and theme are in use and change them to xp defaults if so, so i can alter the files?
if i can, how?

thanks


Theme and wallpaper files shouldn't be "locked" (unwritable) when they're in use. You can try:


SetOutPath "$WINDIR\Web\Wallpaper"
IfFileExists $OUTDIR\My_Wallpaper.jpg "" Write
Delete /REBOOTOK $OUTDIR\My_Wallpaper.jpg
IfFileExists $OUTDIR\My_Wallpaper.jpg "" Write
MessageBox MB_YESNO|MB_ICONQUESTION "To replace the wallpaper, the system must be rebooted.$\n$\nReboot now?" IDNO write
WriteRegStr HKCU "Control Panel\Desktop" "Wallpaper" "$WINDIR\Web\Wallpaper\Bliss.bmp"
WriteRegStr HKCU "Control Panel\Desktop" "ConvertedWallpaper" "$WINDIR\Web\Wallpaper\Bliss.bmp"
; I tend to be very nice to people who click the wrong button by accident ;)
MessageBox MB_OK|MB_ICONINFORMATION \
"Setup is about to reboot your computer. Please save \
and close all open documents and programs, and then \
click OK to reboot your computer."
Reboot
Write:
File My_Wallpaper.jpg

Theme and wallpaper files shouldn't be "locked" (unwritable) when they're in use.
oh, sorry, it was an after thought and i didnt test it. cheers

id still like to know if i can change the current wallpaper and theme though. im now thinking of having options on the finish page to provide those options.
i imagine i probably need to use some system calls, but i know nothing about using the windows api or writing dll's at this time.

is it possible? if i even just know that it is then maybe i can research how to do it later myself.

thanks