All pastes #406752 Raw Edit

Mine

public python v1 · immutable
·published 2007-03-22 17:44 UTC
rendered paste body
## move the mouse testfrom ctypes import *user32 = windll.user32kernel32 = windll.kernel32class RECT(Structure):	_fields_=[	('left', c_ulong),	('top', c_ulong),	('right', c_ulong),	('bottom', c_ulong)	]class GUITHREADINFO(Structure):	_fields_=[	('cbSize', c_ulong),	('flags', c_ulong),	('hwndActive', c_ulong),	('hwndFocus', c_ulong),	('hwndCapture', c_ulong),	('hwndMenuOwner', c_ulong),	('hwndMoveSize', c_ulong),	('hwndCaret', c_ulong),	('rcCaret', RECT)	]def moveCursorInCurrentWindow(x,y):	#Find focused window	guiThreadInfo = GUITHREADINFO(cbSize=sizeof(GUITHREADINFO))	user32.GetGUIThreadInfo(0, byref(guiThreadInfo))	focussedWindow = guiThreadInfo.hwndFocus		windowRect = RECT()	user32.GetWindowRect(focussedWindow, byref(windowRect)	user32.SetCursorPos(windowRect.left + x, windowRect.top + y)if __name__=='__main__':	moveCursorInCurrentWindow(100,100)