-
Python (
http://www.daniweb.com/forums/forum114.html)
| Paul Thompson | Mar 23rd, 2009 4:28 am | |
| Set the Desktop Background 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 |
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)
| shadwickman | Mar 30th, 2009 9:36 pm | |
| It would be nice if you explained the code above rather than just plopping it down on the page. |
| All times are GMT -4. The time now is 9:43 am. | |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC