Jump to content

Background


Recommended Posts

  • Moderators

Yugo?????

No wonder you were in a car accident

lol

8)

Lmao... I was thinking cheap to expensive, first 2 things that came to mind (is that a freudian thing? :), better call my psychiatrist :mellow: )

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

Had to make some minor changes to get this to work on Win XP Pro SP2, only works with bitmaps tho.

WinMinimizeAll()

_ChangeWallpaper(@MyDocumentsDir & '\My Pictures\autoit_builder_wall_1024x768.bmp')
Sleep(20000)
_ChangeWallpaper(@MyDocumentsDir & '\My Pictures\autoit9_wall_grey_1024x768.bmp')

Func _ChangeWallpaper($sFile, $iType = 2)
    Local Const $SPI_SETDESKWALLPAPER = 20
    Local Const $SPIF_SENDWININICHANGE = 0x2
; $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", $SPI_SETDESKWALLPAPER, "int", 0, "str", $sFile, "int", $SPIF_SENDWININICHANGE)
    Return 1
EndFunc  ;==>_ChangeWallpaper

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Link to comment
Share on other sites

Could you try making your background change to this image file in question manually using the normal Windows option and see if it works. If not, then the problem is with your renamed image file. If it works, then the problem has been narrowed down to your code.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...