mouse_event api函数.鼠标移动使用第一个函数: mouse_event(MOUSEEVENTF_MOVE+MOUSEEVENTF_ABSOLUTE,x,y,0, 0 ); 其中X, Y是屏幕的坐标。 鼠标左键单击(双击的话就执行两次 :)): mouse_event(MOUSEEVENTF_LEFTDOWN,x,y,0, 0 ); mouse_event(MOUSEEVENTF_LEFTUP,x,y,0, 0 ); 同理,右键,中键用下面的参数 MOUSEEVENTF_RIGHTDOWN Specifies that the right button changed to down. MOUSEEVENTF_RIGHTUP Specifies that the right button changed to up. MOUSEEVENTF_MIDDLEDOWN Specifies that the middle button changed to down. MOUSEEVENTF_MIDDLEUP Specifies that the middle button changed to up. 滚轮滚动消息: MOUSEEVENTF_WHEEL 拖动操作就是先执行DOWN,再MOVE,然后UP
其中X, Y是屏幕的坐标。
鼠标左键单击(双击的话就执行两次 :)):
mouse_event(MOUSEEVENTF_LEFTDOWN,x,y,0, 0 );
mouse_event(MOUSEEVENTF_LEFTUP,x,y,0, 0 );
同理,右键,中键用下面的参数
MOUSEEVENTF_RIGHTDOWN Specifies that the right button changed to down.
MOUSEEVENTF_RIGHTUP Specifies that the right button changed to up.
MOUSEEVENTF_MIDDLEDOWN Specifies that the middle button changed to down.
MOUSEEVENTF_MIDDLEUP Specifies that the middle button changed to up.
滚轮滚动消息:
MOUSEEVENTF_WHEEL
拖动操作就是先执行DOWN,再MOVE,然后UP