cool!
Code archives/Miscellaneous/Change Desktop Wallpaper
This code has been declared by its author to be Public Domain code.
Download source code
| 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
Doesn't work with jpg ... only bmp files
I found this searching the web:
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
'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
WOT ABOUT A MAX VERSION?
This doesn't work, it gives me an error that says "Function 'systemparametersinfo' not found.".
zortzblatz create a decls file with the
in it called user32.decls in the decls folder of blitz and it should work.
; 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.
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?