| | |
Set the Desktop Background
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
This is a simple program and all it does is fiddle with the registry and set the value of the desktop background to be the bmp file that you supply in the function. There are other things you can do with the windows registry, this is just one of the easy things that demonstrates how it all works.
Enjoy
Enjoy
import win32api, win32con, win32gui def setBackground(image): key = win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER,"Control Panel\\Desktop",0,win32con.KEY_SET_VALUE) win32api.RegSetValueEx(key, "WallpaperStyle", 0, win32con.REG_SZ,"0") win32api.RegSetValueEx(key, "TileWallpaper", 0, win32con.REG_SZ,"0") win32gui.SystemParametersInfo(win32con.SPI_SETDESKWALLPAPER, image, 1+2)
Similar Threads
- How to set background image of CTreeCtrl? (C++)
- how to set a JPanel as ur background? is it possible? (Java)
- vista won't set desktop background (Windows Vista and Windows 7)
- Not able to set the background color of JComponent (Java)
- Windows ME, lost toolbar, start button, desktop icons. Desktop background shows up ok (Windows 95 / 98 / Me)
| Thread Tools | Search this Thread |
accessdenied advanced application argv beginner change color command convert csv cursor def dictionary digital dynamic dynamically edit editing enter event examples excel file float format frange function google gui homework i/o import input jaunty java keyboard lapse line linux list lists loop microphone mouse movingimageswithpygame newb number numbers numeric obexftp output parameters parsing path port prime programming projects py2exe pygame pygtk pyopengl python random recursion remote return reverse scrolledtext session simple skinning smtp sprite stderr string strings subprocess syntax table tennis terminal text thread threading time tkinter tlapse tuple tutorial ubuntu unicode unit urllib urllib2 variable voip web-scrape windows wxpython



