TheOnlyOne Posted January 22, 2009 Posted January 22, 2009 are there a script to chance the deskop background ?
Monamo Posted January 22, 2009 Posted January 22, 2009 are there a script to chance the deskop background ?Short answer -> check here. Methodology: You'll need to change the "Wallpaper" value in the registry under HKEY_CURRENT_USER\Control Panel\Desktop to update the path to the new image ("WallpaperStyle" changes stretch/center/tile option), then run: RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters Happy scripting. - MoChr(77)& Chr(97)& Chr(100)& Chr(101)& Chr(32)& Chr(121)& Chr(97)& Chr(32)& Chr(108)& Chr(111)& Chr(111)& Chr(107)-------I've told you 100,000 times not to exaggerate!-------Don't make me hit you with my cigarette hand...-------My scripts:Random Episode Selector, Keyboard MouseMover, CopyPath v2.1, SmartRename for XP,Window Tracer[sup]New![/sup]
TheOnlyOne Posted January 22, 2009 Author Posted January 22, 2009 Short answer -> check here. Methodology: You'll need to change the "Wallpaper" value in the registry under HKEY_CURRENT_USER\Control Panel\Desktop to update the path to the new image ("WallpaperStyle" changes stretch/center/tile option), then run: RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters Happy scripting. hmm i seached now and i found this expandcollapse popupFunc _ChangeWallpaper($sFile,$iType) ; Changes the wallpaper to $sFilename using $iType as: ; 1 Tiled ; 2 Centered ; 3 Stretched ; any other value (usually 0) unchanged ; ; Returns ; 0 if everything is allright. ; -1 if $sFile does not exist. @error is set to 1 ; -2 if £sFile is not a .bmp file. @error is set to 2 If Not FileExists($sFile) Then SetError(1) Return -1 EndIf If StringTrimLeft($sFile,StringInStr($sFile,'.',0,-1)) <> 'bmp' Then SetError(2) Return -2 EndIf Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','1') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 2 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 3 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','2') Case Else ; EndSelect RegWrite('HKCU\Control Panel\Desktop','Wallpaper','reg_sz',$sFile) DllCall("user32","int","SystemParametersInfo","int",20,"int",0,"str",$sFile,"int",0) Return 0 EndFunc but how do i chance what file i want to be at the background?
Authenticity Posted January 22, 2009 Posted January 22, 2009 If I understand you correctly then the first parameter $sFile should contain the full path string to the bitmap file with the extension .bmp or change it inside the function to filter also .jpg or .gif etc...
FireFox Posted January 22, 2009 Posted January 22, 2009 @Authenticity Example : _ChangeWallPaper("yourfile.bmp", 1) ;dir with bmp name and titled to desktop Cheers, FireFox.
TheOnlyOne Posted January 22, 2009 Author Posted January 22, 2009 @Authenticity Example : _ChangeWallPaper("yourfile.bmp", 1) ;dir with bmp name and titled to desktop Cheers, FireFox. tryed like you say expandcollapse popupFunc _ChangeWallPaper("C:\Documents and Settings\lo\Skrivebord\gaza_20090117_rafah.bmp", 1) ; Changes the wallpaper to $sFilename using $iType as: ; 1 Tiled ; 2 Centered ; 3 Stretched ; any other value (usually 0) unchanged ; ; Returns ; 0 if everything is allright. ; -1 if $sFile does not exist. @error is set to 1 ; -2 if £sFile is not a .bmp file. @error is set to 2 If Not FileExists($sFile) Then SetError(1) Return -1 EndIf If StringTrimLeft($sFile,StringInStr($sFile,'.',0,-1)) <> 'bmp' Then SetError(2) Return -2 EndIf Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','1') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 2 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 3 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','2') Case Else ; EndSelect RegWrite('HKCU\Control Panel\Desktop','wallpaper','reg_sz',$sFile) DllCall("user32","int","SystemParametersInfo","int",20,"int",0,"str",$sFile,"int",0) Return 0 EndFunc but when i try to run it this error comes up C:\Documents and Settings\lo\Skrivebord\oooo.au3(3,88) : ERROR: syntax error Func _ChangeWallPaper("C:\Documents and Settings\lo\Skrivebord\gaza_20090117_rafah.bmp" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\lo\Skrivebord\oooo.au3(16,27) : WARNING: $sFile: possibly used before declaration. If Not FileExists($sFile) ~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\lo\Skrivebord\oooo.au3(26,15) : WARNING: $iType: possibly used before declaration. Case $iType = ~~~~~~~~~~~~~~^ C:\Documents and Settings\lo\Skrivebord\oooo.au3(16,27) : ERROR: $sFile: undeclared global variable. If Not FileExists($sFile) ~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\Documents and Settings\lo\Skrivebord\oooo.au3 - 2 error(s), 2 warning(s)
FireFox Posted January 22, 2009 Posted January 22, 2009 @TheOnlyOne You have to call function with parameters so let function like it was when you found it and write my example before the function Cheers, FireFox.
Authenticity Posted January 22, 2009 Posted January 22, 2009 you're declaring and calling the function at once ^^ it should be declared like this: Func _ChangeWallPaper($sFile, $iType) and called like this: _ChangeWallPaper("C:\Test.bmp", 1) don't forget that if the current working directory is already C: you can omit the C: and call it with the file name only...
TheOnlyOne Posted January 22, 2009 Author Posted January 22, 2009 you're declaring and calling the function at once ^^ it should be declared like this: Func _ChangeWallPaper($sFile, $iType) and called like this: _ChangeWallPaper("C:\Test.bmp", 1) don't forget that if the current working directory is already C: you can omit the C: and call it with the file name only... kk tryed that now i got it like this expandcollapse popupFunc _ChangeWallpaper($sFile,$iType) ; Changes the wallpaper to $sFilename using $iType as: ; 1 Tiled ; 2 Centered ; 3 Stretched ; any other value (usually 0) unchanged ; ; Returns ; 0 if everything is allright. ; -1 if $sFile does not exist. @error is set to 1 ; -2 if £sFile is not a .bmp file. @error is set to 2 If Not FileExists($sFile) Then SetError(1) Return -1 EndIf If StringTrimLeft($sFile,StringInStr($sFile,'.',0,-1)) <> 'bmp' Then SetError(2) Return -2 EndIf Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','1') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 2 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 3 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','2') Case Else EndSelect RegWrite('HKCU\Control Panel\Desktop','Wallpaper','reg_sz',$sFile) DllCall("user32","int","SystemParametersInfo","int",20,"int",0,"str",$sFile,"int",0) _ChangeWallpaper("c:\Documents and Settings\lo\Skrivebord\gaza.bmp",1) Return 0 EndFunc but still it dont chance background?
Authenticity Posted January 22, 2009 Posted January 22, 2009 (edited) does the dll call at the end should be like that? I mean it supposed to be .dll or I'm wrong Edit: oh sorry me clumsy =] change DllCall("user32") to -> DllCall("User32.dll", ...) Edited January 22, 2009 by Authenticity
TheOnlyOne Posted January 22, 2009 Author Posted January 22, 2009 does the dll call at the end should be like that? I mean it supposed to be .dll or I'm wrong Edit: oh sorry me clumsy =] change DllCall("user32") to -> DllCall("User32.dll", ...) now it like this expandcollapse popupFunc _ChangeWallpaper($sFile,$iType) ; Changes the wallpaper to $sFilename using $iType as: ; 1 Tiled ; 2 Centered ; 3 Stretched ; any other value (usually 0) unchanged ; ; Returns ; 0 if everything is allright. ; -1 if $sFile does not exist. @error is set to 1 ; -2 if £sFile is not a .bmp file. @error is set to 2 If Not FileExists($sFile) Then SetError(1) Return -1 EndIf If StringTrimLeft($sFile,StringInStr($sFile,'.',0,-1)) <> 'bmp' Then SetError(2) Return -2 EndIf Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','1') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 2 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 3 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','2') Case Else EndSelect RegWrite('HKCU\Control Panel\Desktop','Wallpaper','reg_sz',$sFile) DllCall("User32.dll","int","SystemParametersInfo","int",20,"int",0,"str",$sFile,"int",0) _ChangeWallpaper("c:\Documents and Settings\lo\Skrivebord\gaza.bmp",1) Return 0 EndFunc but still dont work?
FireFox Posted January 22, 2009 Posted January 22, 2009 @TheOnlyOne Have you read my reply ? _ChangeWallPaper("c:\...) has to be before the function, not in ! Cheers, FireFox.
Authenticity Posted January 22, 2009 Posted January 22, 2009 (edited) It's ok, everyone make mistakes sometimes Here, this one should work ya: expandcollapse popup_ChangeWallpaper("c:\Documents and Settings\lo\Skrivebord\gaza.bmp",1) ; only a simple cut & paste Func _ChangeWallpaper($sFile,$iType) ; Changes the wallpaper to $sFilename using $iType as: ; 1 Tiled ; 2 Centered ; 3 Stretched ; any other value (usually 0) unchanged ; ; Returns ; 0 if everything is allright. ; -1 if $sFile does not exist. @error is set to 1 ; -2 if £sFile is not a .bmp file. @error is set to 2 If Not FileExists($sFile) Then SetError(1) Return -1 EndIf If StringTrimLeft($sFile,StringInStr($sFile,'.',0,-1)) <> 'bmp' Then SetError(2) Return -2 EndIf Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','1') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 2 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 3 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','2') Case Else EndSelect RegWrite('HKCU\Control Panel\Desktop','Wallpaper','reg_sz',$sFile) DllCall("User32.dll","int","SystemParametersInfo","int",20,"int",0,"str",$sFile,"int",0) Return 0 EndFunc Edited January 22, 2009 by Authenticity
TheOnlyOne Posted January 22, 2009 Author Posted January 22, 2009 @TheOnlyOne Have you read my reply ? _ChangeWallPaper("c:\...) has to be before the function, not in ! Cheers, FireFox. like this ? expandcollapse popupFunc _ChangeWallpaper($sFile,$iType) ; Changes the wallpaper to $sFilename using $iType as: ; 1 Tiled ; 2 Centered ; 3 Stretched ; any other value (usually 0) unchanged ; ; Returns ; 0 if everything is allright. ; -1 if $sFile does not exist. @error is set to 1 ; -2 if £sFile is not a .bmp file. @error is set to 2 If Not FileExists($sFile) Then SetError(1) Return -1 EndIf If StringTrimLeft($sFile,StringInStr($sFile,'.',0,-1)) <> 'bmp' Then SetError(2) Return -2 EndIf Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','1') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 2 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 3 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','2') Case Else EndSelect _ChangeWallPaper("c:\Documents and Settings\lo\Skrivebord\gaza.bmp", 1) RegWrite('HKCU\Control Panel\Desktop','Wallpaper','reg_sz',$sFile) DllCall("User32.dll","int","SystemParametersInfo","int",20,"int",0,"str",$sFile,"int",0) Return 0 EndFunc tryed other plases but dident work there ether ?
FireFox Posted January 22, 2009 Posted January 22, 2009 @TheOnlyOne I cant do anything for you... Cheers, FireFox.
TheOnlyOne Posted January 22, 2009 Author Posted January 22, 2009 @TheOnlyOne I cant do anything for you...Cheers, FireFox.to bad :/
FireFox Posted January 22, 2009 Posted January 22, 2009 @TheOnlyOne Example in #13 reply should work... Cheers, FireFox.
TheOnlyOne Posted January 22, 2009 Author Posted January 22, 2009 It's ok, everyone make mistakes sometimes Here, this one should work ya: expandcollapse popup_ChangeWallpaper("c:\Documents and Settings\lo\Skrivebord\gaza.bmp",1) ; only a simple cut & paste Func _ChangeWallpaper($sFile,$iType) ; Changes the wallpaper to $sFilename using $iType as: ; 1 Tiled ; 2 Centered ; 3 Stretched ; any other value (usually 0) unchanged ; ; Returns ; 0 if everything is allright. ; -1 if $sFile does not exist. @error is set to 1 ; -2 if £sFile is not a .bmp file. @error is set to 2 If Not FileExists($sFile) Then SetError(1) Return -1 EndIf If StringTrimLeft($sFile,StringInStr($sFile,'.',0,-1)) <> 'bmp' Then SetError(2) Return -2 EndIf Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','1') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 2 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','0') Case $iType = 3 RegWrite('HKCU\Control Panel\Desktop','TileWallpaper','reg_sz','0') RegWrite('HKCU\Control Panel\Desktop','WallpaperStyle','reg_sz','2') Case Else EndSelect RegWrite('HKCU\Control Panel\Desktop','Wallpaper','reg_sz',$sFile) DllCall("User32.dll","int","SystemParametersInfo","int",20,"int",0,"str",$sFile,"int",0) Return 0 EndFuncthanks that works but just got a other question hmm what is the @dir for a other drive then c: for i wanna load from a other drive ?
Authenticity Posted January 22, 2009 Posted January 22, 2009 (edited) I wouldn't suggest doing this kind of thing, especially on slow machines because the viewer invoke it from different sectors and it can sometimes be a pain for the refresh rate or I'm just the only one who copying files from C:\* to D:\* is slow for ^^ anyway nothing special, just submit the full path to the D:\ path as it was with the C:\ path. Edited January 22, 2009 by Authenticity
TheOnlyOne Posted January 28, 2009 Author Posted January 28, 2009 (edited) I wouldn't suggest doing this kind of thing, especially on slow machines because the viewer invoke it from different sectors and it can sometimes be a pain for the refresh rate or I'm just the only one who copying files from C:\* to D:\* is slow for ^^ anyway nothing special, just submit the full path to the D:\ path as it was with the C:\ path.okay thanks got a last question and dont know about its possiblebut i want to chance the background on all computers on my school is that possible? Edited January 28, 2009 by TheOnlyOne
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