Sign in to follow this  
Followers 0
E1M1

how to make autoit script that sets file as wallpaper?

5 posts in this topic

How to make script that sets new wallpaper? If I just overwrite registry values then I have to log off and on to see new wall paper but how to I write script that applies new image instantly?


edited

Share this post


Link to post
Share on other sites



I found function but problem is: It cant set *.jpg image as background (it worked fine with *.bmp) anyone know what's wrong?

Global $REG_DESKTOP = "HKEY_CURRENT_USER\Control Panel\Desktop"
_ChangeDestopWallpaper("C:\Documents and Settings\rain\Desktop\pildid\Picture 001.jpg",2)
Func _ChangeDestopWallpaper($img, $style = 0)
    Local $SPI_SETDESKWALLPAPER = 20
    Local $SPIF_UPDATEINIFILE = 1
    Local $SPIF_SENDCHANGE = 2
    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", $img, _
            "int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE))

    Return 0
EndFunc   ;==>_ChangeDestopWallpaper

edited

Share this post


Link to post
Share on other sites

I found function but problem is: It cant set *.jpg image as background (it worked fine with *.bmp) anyone know what's wrong?

Look here E1M1, that api function only supports bitmaps. When you select a desktop image through the windows gui it creates a bmp copy of that image in the profile directory.

Share this post


Link to post
Share on other sites

How to make script that sets new wallpaper? If I just overwrite registry values then I have to log off and on to see new wall paper but how to I write script that applies new image instantly?

have a look at this

http://www.autoitscript.com/forum/index.php?showtopic=105962&view=findpost&p=748483&hl=wallpaper&fromsearch=1


Wallpaper Rotatorwith overlay, Loop through a folder of wallpaper & another of overlay, then create a combined image and set it as the wallpaperE-Mail passthru, Send any file, even executables via e-mail as plain text. The recipient can then later re-construct them.Slideshow widget, A slideshow widget similar to the Vista onePredictive typing using the Numpad, Predictive typing using the numpad of a keyboar similar to that on a mobile phone (the key is the .t16 file).PSTools Front End, For Remote Admin. Just makes life a lot easier (Demonstrates executing external programs and passing parameters, tabbed form Handling STDIN/STDERR)FTP Helper application Up and Download files from an FTP server demonstrates this and Tooltray TipsShow a Map of your Post-codes/Zip Codes, Uses the Clipboard, Hotkeys, the system tray (incl. menus)Disc/CD/DVD Catalogue, Ideal for all those Covermount Discs (Demonstrates Array handling, executing DOS programs, handling STDIN/STDOUT recursive directory reads, file searching.)YAST , Yet another Stopwatch/Timer (Uses a hotkey, Copies to clipboard, handles multiple events and stays on top)Keyboard Status Indicator , Indicates status of NumLock, Caps Lock and Scroll Lock Keys, demonstrates API calling & System tray Icon Toggling

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