Click to See Complete Forum and Search --> : MOUSE_EVENT Problem


INT 3
May 3rd, 2007, 07:18 AM
I'm trying to emulate mouse input on an application using DirectX to draw the graphics and the API I have chosen is mouse_event (please don't tell me about SendInput unless it has a direct relation to my issue, I know it superseded by it) and this only seems to move the mouse. (in the incorrect position, I might add) I believe my syntax usage is correct & I've checked with MSDN to be sure but no avail Does anyone know what my issue is? If so, any help would be appreciated.

mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, 500, 250, 0, 0);
mouse_event(MOUSEEVENTF_LEFTDOWN | MOUSEEVENTF_ABSOLUTE, 500, 250, 0, 0);
mouse_event(MOUSEEVENTF_LEFTUP | MOUSEEVENTF_ABSOLUTE, 500, 250, 0, 0);

Thanks in advance.

Boris K K
May 4th, 2007, 11:20 AM
Have you tried if it works with some regular (non-DirectX) Windows application?

Another idea: try adding some delay between mouse down and up events.

golanshahar
May 4th, 2007, 03:26 PM
This thread (http://www.codeguru.com/forum/showthread.php?t=285037) might help you ;)

Cheers