I\'m working on a simple (I thought) program to set a different desktop background for every day of the week. It runs with no errors but nothing happens. The path to the ima
I must have read every existing site on this topic and just before giving up, came to this working code (win7 pro 64 bit, python 3.4)
import ctypes
SPI_SETDESKWALLPAPER = 0x14 #which command (20)
SPIF_UPDATEINIFILE = 0x2 #forces instant update
src = r"D:\Downloads\_wallpapers\3D-graphics_Line_025147_.jpg" #full file location
#in python 3.4 you have to add 'r' before "path\img.jpg"
print(ctypes.windll.user32.SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, src, SPIF_UPDATEINIFILE))
It uses SystemParametersInfoW instead of SystemParametersInfoA (W instead of A).
Hope it helps you and many others who seem to have similar problems.