求助大神怎么写一个模拟鼠标点击的代码用mo
1个回答
展开全部
MFC 工程把以下代码放到你想要响应的函数里面就行CPoint pt;
GetCursorPos(&pt);//获取鼠标在屏幕的当前位置
SetCursorPos(100,200);//移动到某点坐标
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);//点下右键
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);//松开右键
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);//点下左键
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);//松开左键
GetCursorPos(&pt);//获取鼠标在屏幕的当前位置
SetCursorPos(100,200);//移动到某点坐标
mouse_event(MOUSEEVENTF_RIGHTDOWN,0,0,0,0);//点下右键
mouse_event(MOUSEEVENTF_RIGHTUP,0,0,0,0);//松开右键
mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);//点下左键
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);//松开左键
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询