flyingboz Posted October 6, 2005 Share Posted October 6, 2005 expandcollapse popupFunc _ChangeDestopWallpaper($bmp, $style = 0) ;=============================================================================== ; ; Function Name: _ChangeDesktopWallPaper ; Description: Update WallPaper Settings ;Usage: _ChangeDesktopWallPaper(@WindowsDir & '\' & 'zapotec.bmp',1) ; Parameter(s): $bmp - Full Path to BitMap File (*.bmp) ; [$style] - 0 = Centered, 1 = Tiled, 2 = Stretched ; Requirement(s): None. ; Return Value(s): On Success - Returns 0 ; On Failure - -1 ; Author(s): FlyingBoz ;Thanks: Larry - DllCall Example - Tested and Working under XPHome and W2K Pro ; Excalibur - Reawakening my interest in Getting This done. ; ;=============================================================================== If Not FileExists($bmp) Then Return -1 ;The $SPI* values could be defined elsewhere via #include - if you conflict, ; remove these, or add if Not IsDeclared "SPI_SETDESKWALLPAPER" Logic Local $SPI_SETDESKWALLPAPER = 20 Local $SPIF_UPDATEINIFILE = 1 Local $SPIF_SENDCHANGE = 2 Local $REG_DESKTOP= "HKEY_CURRENT_USER\Control Panel\Desktop" if $style = 1 then RegWrite($REG_DESKTOP, "TileWallPaper", "REG_SZ", 1) RegWrite($REG_DESKTOP, "WallpaperStyle", "REG_SZ", 0) Else RegWrite($REG_DESKTOP, "TileWallPaper", "REG_SZ", 0) RegWrite($REG_DESKTOP, "WallpaperStyle", "REG_SZ", $style) EndIf DllCall("user32.dll", "int", "SystemParametersInfo", _ "int", $SPI_SETDESKWALLPAPER, _ "int", 0, _ "str", $bmp, _ "int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) Return 0 EndFunc ;==>_ChangeDestopWallpaper Chuckero 1 Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
w0uter Posted October 6, 2005 Share Posted October 6, 2005 (edited) i have also done this a long time ago.http://www.autoitscript.com/forum/index.ph...topic=13426&hl=and so did ezzetabihttp://www.autoitscript.com/forum/index.php?showtopic=5769 Edited October 6, 2005 by w0uter My UDF's:;mem stuff_Mem;ftp stuff_FTP ( OLD );inet stuff_INetGetSource ( OLD )_INetGetImage _INetBrowse ( Collection )_EncodeUrl_NetStat_Google;random stuff_iPixelSearch_DiceRoll Link to comment Share on other sites More sharing options...
flyingboz Posted October 6, 2005 Author Share Posted October 6, 2005 (edited) @Wouter No offense, but your example doesn't support styles Ezz's example doesn't support optional style, and did not work in my w2k environment. @ALL If anyone tries this on a different OS and gets unexpected results, please let me know. Edited October 6, 2005 by flyingboz Reading the help file before you post... Not only will it make you look smarter, it will make you smarter. Link to comment Share on other sites More sharing options...
parkerbl Posted January 31, 2006 Share Posted January 31, 2006 (edited) What exactly is the $style = 0 parameter that is being passed into _ChangeDestopWallpaper function? Edited January 31, 2006 by parkerbl Link to comment Share on other sites More sharing options...
JoshDB Posted January 31, 2006 Share Posted January 31, 2006 ; [$style]- 0 = Centered, 1 = Tiled, 2 = Stretched The style = 0 in the code basically means that if no style is called, it'll default to 0. Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite Link to comment Share on other sites More sharing options...
SandelPerieanu Posted February 1, 2006 Share Posted February 1, 2006 (edited) Hey man! It's know this a long time ago. try this and stop! *.jpg and *.bmp Edited February 1, 2006 by psandu.ro Link to comment Share on other sites More sharing options...
ludocus Posted March 28, 2008 Share Posted March 28, 2008 I made a bmp converter with it: my wallpaper topic Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now