Windows7x64 Wallpaper Changer Script

I’ve been meaning to make this ever since I discovered win32 stuff. It uses the .2 version of SendKey, found here, that uses ctypes, instead of the win32 stuff I think, as well as working with 64 bit Windows. Make a shortcut to it on your desktop and just run it as a .pyw file, in order to hide the terminal window that pops up. Simple stuff

Anyways, all it does is is simulate a right-click and then an ‘n’ keystroke. It’s just a quick little app, ┬ájust a dozen lines long:

import win32api, win32con
import SendKeys
def click(x=-1,y=-1):
    oldX, oldY = win32api.GetCursorPos()
    win32api.SetCursorPos((x,y))
    win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTDOWN,x,y,0,0)
    win32api.mouse_event(win32con.MOUSEEVENTF_RIGHTUP,x,y,0,0)
    win32api.SetCursorPos((oldX, oldY))

click()
SendKeys.SendKeys('n')