I'm want to simulate a mouse click down in a certain position (not where the mouse cursor is at the current moment):
INPUT Input={0};
// left down
Input.type = INPUT_MOUSE;
Input.mi.dwFlags = MOUSEEVENTF_VIRTUALDESK | MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_LEFTDOWN;
Input.mi.dx = normalized_x;
Input.mi.dy = normalized_y;
::SendInput(1,&Input,sizeof(INPUT));
I'm getting this event in the target process, but with coordinates that are the "real" coordinates of the current mouse pointer position and not what I've sent. What am I missing? Is this a normal behavior?