4

As you can see, I followed the approach proposed by @meskr from How can I change my desktop background with python? to write my script in order to change my wallpaper.

ctypes.windll.user32.SystemParametersInfoW(20, 0, filepath, 0)

My system is Windows 10, and I use python 3.5. The code works fine, It can help me change my wallpaper correctly. But the wallpaper will reset to the default one when I reboot my system. I don't know why and how to avoid this.

1 Answer 1

-1

I resolved it setting an image from the setting panel of windows, this way windows will reload it from the disk at reboot, then the program will just override the same image with the other that you want to change and re-call

ctypes.windll.user32.SystemParametersInfoW(20, 0, filepath, 0)

this way windows will reload the latest image the program overrided.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.