Evil_Has_Survived Posted April 4, 2006 Share Posted April 4, 2006 ok I looked in the help file and found nothing, well i did find stuff about changing back grounds for a GUI box but nothing about setting my desktop back ground thanks Thanks in advance Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 4, 2006 Author Share Posted April 4, 2006 (edited) HKEY_CURRENT_USER/controlpanel/desktop/Wallpaper maybe this will help what about a regwrite... Edited April 4, 2006 by Evil_Has_Survived Thanks in advance Link to comment Share on other sites More sharing options...
MHz Posted April 4, 2006 Share Posted April 4, 2006 Here is a UDF that change to bmp wallpaper ; Courtesy of ezzetabi. ; The BMP Wallpaperchanger Function. ; Example usage. _ChangeWallpaper('C:\picture.bmp', 1) Func _ChangeWallpaper($sFile, $iType) ; $iType: 1 = Tiled, 2 = Normal size, 3 = Stretched. If Not FileExists($sFile) Then Return 0 If StringTrimLeft($sFile, StringInStr($sFile, '.', 0, -1)) <> 'bmp' Then Return 0 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') EndSelect RegWrite('HKCU\Control Panel\Desktop', 'Wallpaper', 'reg_sz', $sFile) DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $sFile, "int", 0) Return 1 EndFunc Link to comment Share on other sites More sharing options...
Valuater Posted April 4, 2006 Share Posted April 4, 2006 from wOuterFunc _SetWallpaper($s_BitmapImage, $l_params = 0) $ai_Ret = DllCall('user32.dll', 'long', 'SystemParametersInfoA', 'long', 20, 'long', 0, 'str', $s_BitmapImage, 'long', $l_params) Return $ai_Ret[0] EndFunchttp://www.autoitscript.com/forum/index.ph...op++background#8) Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 4, 2006 Author Share Posted April 4, 2006 from wOuter Func _SetWallpaper($s_BitmapImage, $l_params = 0) $ai_Ret = DllCall('user32.dll', 'long', 'SystemParametersInfoA', 'long', 20, 'long', 0, 'str', $s_BitmapImage, 'long', $l_params) Return $ai_Ret[0] EndFunc http://www.autoitscript.com/forum/index.ph...op++background# 8) hmm were it says $s_BitmapImage thats were I type my pic name right like this? $s_untitled lol Im not sure Thanks in advance Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 4, 2006 Author Share Posted April 4, 2006 and with yours it didn't work ; Courtesy of ezzetabi. ; The BMP Wallpaperchanger Function. ; Example usage. _ChangeWallpaper("C:\Documents and Settings\Dietmar franken\My Documents\My Pictures\untitled", 1) Func _ChangeWallpaper($sFile, $iType) ; $iType: 1 = Tiled, 2 = Normal size, 3 = Stretched. If Not FileExists($sFile) Then Return 0 If StringTrimLeft($sFile, StringInStr($sFile, '.', 0, -1)) <> 'bmp' Then Return 0 Select Case $iType = 1 RegWrite('HKCU\Control Panel\Desktop', 'untitled', 'reg_sz', '1') RegWrite('HKCU\Control Panel\Desktop', 'Center', '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') EndSelect RegWrite('HKCU\Control Panel\Desktop', 'untitled', 'reg_sz', $sFile) DllCall("user32", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $sFile, "int", 0) Return 1 EndFunc Thanks in advance Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 4, 2006 Moderators Share Posted April 4, 2006 hmm were it says $s_BitmapImage thats were I type my pic name right like this? $s_untitled lol Im not sureMore like this:_SetWallpaper(@MyDocumentsDir & '\MyPictures\MyBitmap.bmp') Func _SetWallpaper($s_BitmapImage, $l_params = 0) $ai_Ret = DllCall('user32.dll', 'long', 'SystemParametersInfoA', 'long', 20, 'long', 0, 'str', $s_BitmapImage, 'long', $l_params) Return $ai_Ret[0] EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
MHz Posted April 4, 2006 Share Posted April 4, 2006 (edited) and with yours it didn't work ; Example usage. _ChangeWallpaper("C:\Documents and Settings\Dietmar franken\My Documents\My Pictures\untitled", 1)Where in the path given to the function call is the bmp file tp make it work ? Edited April 4, 2006 by MHz Link to comment Share on other sites More sharing options...
Valuater Posted April 4, 2006 Share Posted April 4, 2006 hmm were it says $s_BitmapImage thats were I type my pic name right like this? $s_untitled lol Im not sureyes8) Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 4, 2006 Author Share Posted April 4, 2006 (edited) wow either I am a or it didn't like my picture _SetWallpaper(@MyDocumentsDir & '\MyPictures\untitled.bmp') Func _SetWallpaper($s_untitled, $l_params = 0) $ai_Ret = DllCall('user32.dll', 'long', 'SystemParametersInfoA', 'long', 20, 'long', 0, 'str', $s_untitled, 'long', $l_params) Return $ai_Ret[0] EndFunc I might just make a regwrite that might do it Edited April 4, 2006 by Evil_Has_Survived Thanks in advance Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 4, 2006 Moderators Share Posted April 4, 2006 wow either I am a or it didn't like my pictureNot going there The path is wrong, I was giving an example of how to do it.. it's not MyPictures it's My Pictures _SetWallpaper(@MyDocumentsDir & '\My Pictures\untitled.bmp') Func _SetWallpaper($s_untitled, $l_params = 0) $ai_Ret = DllCall('user32.dll', 'long', 'SystemParametersInfoA', 'long', 20, 'long', 0, 'str', $s_untitled, 'long', $l_params) Return $ai_Ret[0] EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 4, 2006 Author Share Posted April 4, 2006 Not going there The path is wrong, I was giving an example of how to do it.. it's not MyPictures it's My Pictures _SetWallpaper(@MyDocumentsDir & '\My Pictures\untitled.bmp') Func _SetWallpaper($s_untitled, $l_params = 0) $ai_Ret = DllCall('user32.dll', 'long', 'SystemParametersInfoA', 'long', 20, 'long', 0, 'str', $s_untitled, 'long', $l_params) Return $ai_Ret[0] EndFunc rofl ill try it Not going there Thanks in advance Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 4, 2006 Author Share Posted April 4, 2006 Not going there The path is wrong, I was giving an example of how to do it.. it's not MyPictures it's My Pictures _SetWallpaper(@MyDocumentsDir & '\My Pictures\untitled.bmp') Func _SetWallpaper($s_untitled, $l_params = 0) $ai_Ret = DllCall('user32.dll', 'long', 'SystemParametersInfoA', 'long', 20, 'long', 0, 'str', $s_untitled, 'long', $l_params) Return $ai_Ret[0] EndFunc hmm i kept trying it but no use _SetWallpaper(@MyDocumentsDir & '\My Pictures\untitled.bmp') Func _SetWallpaper($s_untitled, $l_params = 0) $ai_Ret = DllCall('user32.dll', 'long', 'SystemParametersInfoA', 'long', 20, 'long', 0, 'str', $s_untitled, 'long', $l_params) Return $ai_Ret[0] EndFunc so untitled is my picture name and it should set it but it doesn't (windows XP) (Bill Gates ) Thanks in advance Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 4, 2006 Moderators Share Posted April 4, 2006 (edited) hmm i kept trying it but no use _SetWallpaper(@MyDocumentsDir & '\My Pictures\untitled.bmp') Func _SetWallpaper($s_untitled, $l_params = 0) $ai_Ret = DllCall('user32.dll', 'long', 'SystemParametersInfoA', 'long', 20, 'long', 0, 'str', $s_untitled, 'long', $l_params) Return $ai_Ret[0] EndFunc so untitled is my picture name and it should set it but it doesn't (windows XP) (Bill Gates )Is your pictue a .bmp extension? And if it is, was it made that way, or did you just rename it .bmp from a .jpg or .gif or something? Edit: MHz's example works well also.... Edited April 4, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 4, 2006 Author Share Posted April 4, 2006 Is your pictue a .bmp extension? And if it is, was it made that way, or did you just rename it .bmp from a .jpg or .gif or something?I renamed it to .bmp it was a jpg Thanks in advance Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 4, 2006 Moderators Share Posted April 4, 2006 I renamed it to .bmp it was a jpg Wouldn't it stand to reason that.. that wouldn't work? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 4, 2006 Author Share Posted April 4, 2006 Wouldn't it stand to reason that.. that wouldn't work?well when I went to the properties of it, it now says a a .bmp lol Thanks in advance Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 4, 2006 Moderators Share Posted April 4, 2006 well when I went to the properties of it, it now says a a .bmp lolYeah, and If I take the Yugo symbol off my car and put a Mercedes one there... does that make it a Mercedes? Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Evil_Has_Survived Posted April 4, 2006 Author Share Posted April 4, 2006 Yeah, and If I take the Yugo symbol off my car and put a Mercedes one there... does that make it a Mercedes?no lol what If I download a picture converter... Thanks in advance Link to comment Share on other sites More sharing options...
Valuater Posted April 4, 2006 Share Posted April 4, 2006 Yeah, and If I take the Yugo symbol off my car and put a Mercedes one there... does that make it a Mercedes?Yugo?????No wonder you were in a car accidentlol8) 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