problem with mouse_event()
-
Hello
mouse_event(MOUSEEVENTF_RIGHTUP,x,y,0,GetMessageExtraInfo());
it works! But with MOUSEEVENTF_LEFTUP and MOUSEEVENTF_ABSOLUTE nothing happens! I think that the fanction has a problem . I write my program in Borland C++Builder version 6. can you help me? thanks
-
Hello
mouse_event(MOUSEEVENTF_RIGHTUP,x,y,0,GetMessageExtraInfo());
it works! But with MOUSEEVENTF_LEFTUP and MOUSEEVENTF_ABSOLUTE nothing happens! I think that the fanction has a problem . I write my program in Borland C++Builder version 6. can you help me? thanks
Did you do MOUSEEVENTF_LEFTDOWN before MOUSEEVENTF_LEFTUP?
-
Did you do MOUSEEVENTF_LEFTDOWN before MOUSEEVENTF_LEFTUP?
-
No , but I think that isn't important. because when I use MOUSEEVENTF_RIGHTUP I dont use MOUSEEVENTF_RIGHTDOWN before it but it works . thanks
That would depend on whatever application that is the receipient of the mouse clicks, and I would imagine that a programmer won't think of a situation in which the mouse button can go up without going down first. Just because it "works" in certain cases doesn't mean it's correct. If you had tried simulating keyboard input with keys going up without coming down first you get fantastic results. Have your taskbar be on the bottom of your primary monitor and visible and run this snippet. Does the start menu pop up? Works for me...
mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, 0, 65535, 0, GetMessageExtraInfo());
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0 ,0,GetMessageExtraInfo());
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0 ,0,GetMessageExtraInfo()); -
That would depend on whatever application that is the receipient of the mouse clicks, and I would imagine that a programmer won't think of a situation in which the mouse button can go up without going down first. Just because it "works" in certain cases doesn't mean it's correct. If you had tried simulating keyboard input with keys going up without coming down first you get fantastic results. Have your taskbar be on the bottom of your primary monitor and visible and run this snippet. Does the start menu pop up? Works for me...
mouse_event(MOUSEEVENTF_MOVE | MOUSEEVENTF_ABSOLUTE, 0, 65535, 0, GetMessageExtraInfo());
mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0 ,0,GetMessageExtraInfo());
mouse_event(MOUSEEVENTF_LEFTUP, 0, 0 ,0,GetMessageExtraInfo());