VBA调用WinAPI,向后台程序发送鼠标消息(鼠标动作)

时间:2015-10-02 11:03:25
【文件属性】:

文件名称:VBA调用WinAPI,向后台程序发送鼠标消息(鼠标动作)

文件大小:23KB

文件格式:RAR

更新时间:2015-10-02 11:03:25

VBA sendmessage 外挂 发送消息 后台程序

本附件用excel自带的VBA,调用windowsAPI 用 mouse_event 实现了对前台程序发送按键和鼠标动作 用 sendmessege 实现了对后台程序发送鼠标动作 做法是 先人手打开画图程序,切换回excel点击按钮 就可以在画图程序画出一个正方形图案 对想要学习 如何 sendmessage 到后台程序的同学很有帮助。 Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wparam As Long, ByVal lparam As Long) As Long Public Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long Public Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)


【文件预览】:
WinAPI - 向后台程序发送鼠标动作.xls

网友评论