VB从零开始编外挂(五)
图老师小编精心整理的VB从零开始编外挂(五)希望大家喜欢,觉得好的亲们记得收藏起来哦!您的支持就是小编更新的动力~
--------------------------------------------------------------------------------------------------------------------------------------------------------
需要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->