文章列表
模拟鼠标点击:
def click(handle, pos):
client_pos = win32gui.ScreenToClient(handle, pos)
tmp = win32api.MAKELONG(client_pos[0], client_pos[1])
win32gui.SendMessage(handle, win32con.WM_ACTIVATE, win32con.WA_ACTIVE, 0)
win32api.SendMessage(handle, win32con.WM_LBUTTONDOWN, win32con.MK_LBUTTON ...
pywin安装模块:http://sourceforge.net/projects/pywin32/files/
import win32api
import win32con
win32api.keybd_event(17,0,0,0) #ctrl键位码是17
win32api.keybd_event(86,0,0,0) #v键位码是86
win32api.keybd_event(86,0,win32con.KEYEVENTF_KEYUP,0) #释放按键
win32api.keybd_event(17,0,win32con.KEYEVENTF_KEYUP,0)
附个键位码表:
字母 ...
# -*- coding: utf-8 -*-
#
# by oldj
# http://oldj.net/
#
import pythoncom
import pyHook
def onMouseEvent(event):
# 监听鼠标事件
print "MessageName:", event.MessageName
print "Message:", event.Message
print "Time:", event.Time
print "Window:", ev ...