ctypes ques

Dietmar Schwertberger dietmar at schwertberger.de
Mon Aug 4 14:46:25 EDT 2003


In article <mailman.1059945127.2702.python-list at python.org>, ryan
<URL:mailto:toxicpulse at sbcglobal.net> wrote:
> the win32 python extentions don't seem to have "SysParametersInfo()" and i need it to 
> set the wallpaper in windows. 
> 
> cyptes has a "SysParametersInfoA()" function but wont let me use the SPI_SETDESKWALLPA
> PER attribute.
> 
> anyone have any ideas how i can set the windows wallpaper from a python program?

This is what I've been using with windll:

def set_wallpaper(wallpaper):
    # refresh wallpaper
    try:
        import windll
        g = windll.module("user32")
        buf = windll.cstring(wallpaper)
        g.SystemParametersInfo(20, 0, buf, 3)
    except:
        pass


Regards,

Dietmar





More information about the Python-list mailing list