I found following command to set the Desktop Wallpaper of Windows using Python:
ctypes.windll.user32.SystemParametersInfoA(0x14, 0, 'C:\somepic.jpg', 0)
Unfortunately the Wallpaper isn't changed as I expected.
Am I missing something? Or is there another way to (permanently) change the Windows Wallpaper?
Thanks.
Edit:
Found this solution:
cmd = "REG ADD \"HKCU\Control Panel\Desktop\" /v Wallpaper /t REG_SZ /d D:\30-10-2013.jpg" #changes the Registry Key "Wallpaper"
subprocess.call(cmd)
subprocess.call("rundll32.exe user32.dll, UpdatePerUserSystemParameters") #To update the Wallpaper
Problem: By checking the Registry entry you see, that Python messes something up with the encoding, because it removes the \30 and replaces it with a little box (like [] ).
(It works by inserting these commands in a the Windows run-dialoge.)
How to solve this encoding problem?