I want to send a mouse click to a specific position on the screen without affecting the location of the mouse cursor.
I read and tried everything under the sun with mouse_event (which should do this)
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0);
However, this ends up just sending the mouse click to where the mouse pointer is. So I have to move the mouse to make it work.
Cursor.Position = new Point(X, Y);
Does anyone know how I can do this WITHOUT having to move the mouse? I also tried the following block of code without success, as it still only clicked where the mouse cursor position was indicated, which really threw me into the loop, as I figured it would work ...
Cursor.Position = new Point(X, Y); mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_LEFTUP, X, Y, 0, 0); Cursor.Position = new Point(oldX, oldY);
Thanks in advance for your help!
source share