Code archives/Miscellaneous/Change Desktop Wallpaper

This code has been declared by its author to be Public Domain code.

Download source code

Change Desktop Wallpaper by Eikon2004
userlib
; Required Userlib
; .lib "user32.dll"
; SystemParametersInfo%(uAction%, uParam%, lpvParam$, fuWinIni%):"SystemParametersInfoA"

AppTitle "Change Desktop Wallpaper by Eikon"
Graphics 640, 320, 16, 2

Const SET_WALLPAPER% = 20
Const UPDATE_INI_FILE% = 1

file$ = "Cash Out.bmp" ; Change to path of the wallpaper

ret% = SystemParametersInfo(SET_WALLPAPER%, 0, file$, UPDATE_INI_FILE%)
If Not ret% Then RuntimeError "Set Wallpaper failed!"

Comments

jfk EO-111102005
cool!


RGR2006
Doesn't work with jpg ... only bmp files

I found this searching the web:
If I set a JGP as wallpaper, Windows XP converts it to a BMP and saves it in
'C:\Documents and Settings\RGR\Local Settings\Application Data\Microsoft\Wallpaper1.bmp' and sets that BMP as the wallpaper.

The registry entries which relate to this are:
'HKEY_CURRENT_USER\Control Panel\Desktop\ConvertedWalpaper' = JPG file
'HKEY_CURRENT_USER\Control Panel\Desktop\OriginalWallpaper' = BMP file
'HKEY_CURRENT_USER\Control Panel\Desktop\Wallpaper' = BMP file



Boiled Sweets2006
WOT ABOUT A MAX VERSION?


zortzblatz2006
This doesn't work, it gives me an error that says "Function 'systemparametersinfo' not found.".


*2006
zortzblatz create a decls file with the
; Required Userlib
 .lib "user32.dll"
 SystemParametersInfo%(uAction%, uParam%, lpvParam$, fuWinIni%):"SystemParametersInfoA"


in it called user32.decls in the decls folder of blitz and it should work.


zortzblatz2006
Okay, now a window pops up titled "Change Desktop Wallpaper by Eikon". It changes size once then closes leaving the wallpaper unchanged. On the plus side it rune and compiles without error =D Any other suggestions?


Code Archives Forum