MOUSEEVENTF_RIGHTDOWN和MOUSEEVENTF_RIGHTUP按预期工作,但MOUSEEVENTF_MOVE和SetCursorPos不起作用(没有任何反应)。
而且,似乎X和Y对MOUSEEVENTF_RIGHTDOWN和MOUSEEVENTF_RIGHTUP没有影响。
编译opt:gcc -o test.exe test.c
os:windows7
#include <windows.h>
#define X (DWORD)50
#define Y (DWORD)50
int main() {
mouse_event(MOUSEEVENTF_RIGHTDOWN, X, Y, 0, 0);
mouse_event(MOUSEEVENTF_RIGHTUP, X, Y, 0, 0);
mouse_event(MOUSEEVENTF_MOVE, X,Y,0,0);
SetCursorPos(X,Y);
return 0;
}