0

After changing the background correctly with the famous ctypes

import ctypes
ctypes.windll.user32.SystemParametersInfoW(SPI_SETDESKWALLPAPER, 0, fullpathofimage, 0)

the image was not fitting correctly in the screen, as Windows has 'Tile' as default wallpaper fit. Part of the image outgrew the screen.

¿Is there any way to change the wallpaper fit mode? (Center, Span, Fit, Stretch, etc) After changing the fit mode of the computer, each new change of wallpaper would respect the new fit mode. So it must be a system parameter, but i dont know where to edit.

In this answer, What are the Parameters for in: Python, ctypes.windll.user32.SystemParametersInfoA?, someone replyed with https://code.msdn.microsoft.com/windowsdesktop/cssetdesktopwallpaper-2107409c, but now its down and i can't find anything.

Thank you ind advance.

FLASH3G
  • 23
  • 4
  • Here's an [archive](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/master/OneCodeTeam/Set%20the%20desktop%20wallpaper%20(CSSetDesktopWallpaper)/) of the MSDN page you linked to. – MattDMo Oct 16 '20 at 01:28
  • @MattDMo apreciated. i will try to dig into the solution myself, but if someone has figured it out, i would be also grateful. – FLASH3G Oct 16 '20 at 03:28
  • I know nothing about the weird and f---ed up world of Windows system internals (other than it's weird and f---ed up), otherwise I'd make an answer. I do have strong Google-fu, though, which is how I found that archive :) – MattDMo Oct 16 '20 at 14:34
  • @MattDMo i ended making the wallpaper smaller, so it is never shrunk and always full displayed. – FLASH3G Oct 29 '20 at 20:21
  • I faced same task and I have not figured out any method besides changing registry keys in "HKEY_CURRENT_USER\\Control Panel\Desktop" with the use of winreg package in Python. – Sib Dec 31 '21 at 14:57

0 Answers0