Sign in to follow this  
Followers 0
Evil_Has_Survived

Background

26 posts in this topic

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

HKEY_CURRENT_USER/controlpanel/desktop/Wallpaper maybe this will help

what about a regwrite...

Edited by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

hmm were it says $s_BitmapImage thats were I type my pic name right like this? $s_untitled lol Im not sure

More 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

[center]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.[/center]

Share this post


Link to post
Share on other sites

#8 ·  Posted (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 by MHz

Share this post


Link to post
Share on other sites

hmm were it says $s_BitmapImage thats were I type my pic name right like this? $s_untitled lol Im not sure

yes

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

#10 ·  Posted (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 by Evil_Has_Survived

Thanks in advance

Share this post


Link to post
Share on other sites

wow either I am a :) or it didn't like my picture

Not going there :mellow:

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

[center]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.[/center]

Share this post


Link to post
Share on other sites

Not going there :mellow:

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

Share this post


Link to post
Share on other sites

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 :):):o:mellow:)


Thanks in advance

Share this post


Link to post
Share on other sites

#14 ·  Posted (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 :):):o:mellow:)

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 by SmOke_N

[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

I renamed it to .bmp it was a jpg

:)

Wouldn't it stand to reason that.. that wouldn't work?


[center]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.[/center]

Share this post


Link to post
Share on other sites

:)

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

Share this post


Link to post
Share on other sites

well when I went to the properties of it, it now says a a .bmp lol

Yeah, and If I take the Yugo symbol off my car and put a Mercedes one there... does that make it a Mercedes?

[center]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.[/center]

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 accident

lol

8)


NEWHeader1.png

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0