Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (16.4k points)
edited by

I am trying to execute Python code like clockwork to refresh a Windows 7 desktop background. It runs consummately when begun from the command-line, however not as a planned undertaking. 

Code:

import ctypes

# According to MSDN/other websites

SPI_SETDESKWALLPAPER = 20

# Update wallpaper

ctypes.windll.user32.SystemParametersInfoA(SPI_SETDESKWALLPAPER, 0, pathToWallpaper, 0)

The scheduled task runs, and my transitory .bmp (at pathToWallpaper) is made, yet the work area doesn't refresh.

Is there anything I'm missing? If yes, please let me know. 

1 Answer

0 votes
by (26.4k points)
edited by

Just make sure whether the Scheduled task is executing with a similar advantage as you.

Looking for a good python tutorial course? Join the python certification course and get certified.

Watch the below video tutorial for more details...

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...