Sign in to follow this  
Followers 0
kloyenz

Change Desktop Wallpaper

7 posts in this topic

Hello,

Does anybody know how to change the desktop wallpaper to a downloaded file without the user seeing any backgrounds ? And afterwards refreshing the background so that the new foto is visible immediatly ?

Thnx

Share this post


Link to post
Share on other sites



...try something like this:

RegWrite("HKEY_CURRENT_USER\Control Panel\Desktop", "wallpaper", "REG_SZ", "mybmp.bmp")
EnvUpdate()

:D

Share this post


Link to post
Share on other sites

aye, I had the same issue, if you open the properties window tab to the backround and click ok, then it refreshes.


AutoIt3, the MACGYVER Pocket Knife for computers.

Share this post


Link to post
Share on other sites

Solution!!

Pseudocode :

Run(@comspec & " /c " & @Windowsdir & "\system32\desk.cpl","",@sw_hide) ;Real code actually..

WinWait(the window)

Send( the ALT+? combination to go in the list) ;Language dependant

Send( file name, no ext)

Send("{Enter}")

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

What about using ControlSend? That would not be language dependant, right?

; in Win98 (untested)
Run("Control.exe Desk.cpl", @SW_HIDE)  
WinWait("Display Properties") ;Language Dependant
ControlFocus("Display Properties", "", "SysListView321")
ControlSend("Display Properties", "", "SysListView321", "Clouds")
ControlClick("Display Properties", "", "Button4"); Ok button

Edit: Fix function call.

Edited by Nutster

David Nuttall
Nuttall Computer Consulting

An Aquarius born during the Age of Aquarius

AutoIt allows me to re-invent the wheel so much faster.

I'm off to write a wizard, a wonderful wizard of odd...

Share this post


Link to post
Share on other sites

;Working on my W2000 computer with Active desktop disabled.

$title = "Display Properties"
$wallpaper = "winnt";<------- Put here the filename you want after you copied the .bmp file it in @windir. (or set it "(none)")

Run(@comspec & " /c " & @Windowsdir & "\system32\desk.cpl","",@sw_hide)
WinWait($title)
ControlFocus($title, "", "ListBox2")
ControlSend($title, "", "ListBox2",$wallpaper)
ControlClick($title, "", "Button7"); Ok button

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