Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Set Windows Desktop Wallpaper

DZone's Guide to

Set Windows Desktop Wallpaper

·
Free Resource
Set windows desktop wallpaper to the given bitmap file (jpegs etc must be converted to bmp format).


def setWallpaper( bmp ):
	import win32api, win32con, win32gui
	k = win32api.RegOpenKeyEx(win32con.HKEY_CURRENT_USER,"Control Panel\\Desktop",0,win32con.KEY_SET_VALUE)
	win32api.RegSetValueEx(k, "WallpaperStyle", 0, win32con.REG_SZ, "0")
	win32api.RegSetValueEx(k, "TileWallpaper", 0, win32con.REG_SZ, "0")
	win32gui.SystemParametersInfo(win32con.SPI_SETDESKWALLPAPER, bmp, 1+2)
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}