欢迎光临
我们一直在努力

vb从零开始编外挂(五)_visualbasic教程

建站超值云服务器,限时71元/月

前边谈了模拟键盘,下面说说模拟鼠标。
——————————————————————————————————————————————————–
需要VBAPI函数:
mouse_event←模拟一次鼠标事件
——————————————————————————————————————————————————–
相关API声明:
mouse_event

PrivateDeclareSubmouse_eventLib”user32″(ByValdwFlagsAsLong,ByValdxAsLong,ByValdyAsLong,ByValcButtonsAsLong,ByValdwExtraInfoAsLong)
——————————————————————————————————————————————————–
定义变量:
ConstMOUSEEVENTF_LEFTDOWN=&H2
ConstMOUSEEVENTF_LEFTUP=&H4
ConstMOUSEEVENTF_MIDDLEDOWN=&H20
ConstMOUSEEVENTF_MIDDLEUP=&H40
ConstMOUSEEVENTF_MOVE=&H1
ConstMOUSEEVENTF_ABSOLUTE=&H8000
ConstMOUSEEVENTF_RIGHTDOWN=&H8
ConstMOUSEEVENTF_RIGHTUP=&H10
——————————————————————————————————————————————————–
MOUSEEVENTF_LEFTDOWN鼠标左键按下
MOUSEEVENTF_LEFTUP鼠标松开
MOUSEEVENTF_RIGHTDOWN鼠标右键按下
MOUSEEVENTF_RIGHTUP鼠标右键松开
——————————————————————————————————————————————————–
代码:
PrivateDeclareSubmouse_eventLib”user32″(ByValdwFlagsAsLong,ByValdxAsLong,ByValdyAsLong,ByValcButtonsAsLong,ByValdwExtraInfoAsLong)
ConstMOUSEEVENTF_LEFTDOWN=&H2
ConstMOUSEEVENTF_LEFTUP=&H4
ConstMOUSEEVENTF_MIDDLEDOWN=&H20
ConstMOUSEEVENTF_MIDDLEUP=&H40
ConstMOUSEEVENTF_MOVE=&H1
ConstMOUSEEVENTF_ABSOLUTE=&H8000
ConstMOUSEEVENTF_RIGHTDOWN=&H8
ConstMOUSEEVENTF_RIGHTUP=&H10
这里是鼠标左键按下和松开两个事件的组合即一次单击
mouse_eventMOUSEEVENTF_LEFTDOWNOrMOUSEEVENTF_LEFTUP,0,0,0,0
模拟鼠标右键单击事件
mouse_eventMOUSEEVENTF_RIGHTDOWNOrMOUSEEVENTF_RIGHTUP,0,0,0,0
两次连续的鼠标左键单击事件构成一次鼠标双击事件
mouse_eventMOUSEEVENTF_LEFTDOWNOrMOUSEEVENTF_LEFTUP,0,0,0,0
mouse_eventMOUSEEVENTF_LEFTDOWNOrMOUSEEVENTF_LEFTUP,0,0,0,0->

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » vb从零开始编外挂(五)_visualbasic教程
分享到: 更多 (0)