如何用MFC控制鼠标移动?

2024-11-18 12:20:03
推荐回答(2个)
回答1:

SetCursorPos(x, y);//设置鼠标位置
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);//左键按下
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);//左键弹起

回答2:

SetCursorPos(x, y);//设置鼠标位置
WM_LBUTTONDOWN //左键按下
WM_RBUTTONDOWN//右键弹起
WM_MOVE //鼠标移动