How to raise Mouse click event
-
Hi All! I want to write a program that can raise mouse click event( in other window or desktop), but i don't know how to raise that event.:(( Any Idea??
Can you rephrase the question please? Regards, Polis Can you practice what you teach?
-
Hi All! I want to write a program that can raise mouse click event( in other window or desktop), but i don't know how to raise that event.:(( Any Idea??
Hi there, You can use SendMessage API... it should be something like SendMessage(iHandle, WM_LBUTTONDOWN, 0, lparm); << >>
-
Hi All! I want to write a program that can raise mouse click event( in other window or desktop), but i don't know how to raise that event.:(( Any Idea??
You need to investigate SendMessage and PostMessage. Then, you need to understand the constants WM_LBUTTONDOWN and WM_LBUTTONUP. Then, read Test Run: Low-Level UI Test Automation and you will know everything that you need to accomplish what you want to do. "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty
-
Hi All! I want to write a program that can raise mouse click event( in other window or desktop), but i don't know how to raise that event.:(( Any Idea??
Hi! To send windows a mouse event, you can use the "mouse_event" API of the user32.dll. Decalre as following:
[DllImport("user32.dll")] private static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, int dwExtraInfo);
Here are some constants needed, saved in an enumeration:private enum MouseEventTFlags { LEFTDOWN = 0x00000002, LEFTUP = 0x00000004, MIDDLEDOWN = 0x00000020, MIDDLEUP = 0x00000040, MOVE = 0x00000001, ABSOLUTE = 0x00008000, RIGHTDOWN = 0x00000008, RIGHTUP = 0x00000010 }
Now, you can call it like this:mouse_event((uint)MouseEventTFlags.LEFTDOWN, 0, 0, 0, 0); mouse_event((uint)MouseEventTFlags.LEFTUP , 0, 0, 0, 0);
When you send the press-button-down-event, you need to send the press-button-up-event too! Marcel Erz -
Hi All! I want to write a program that can raise mouse click event( in other window or desktop), but i don't know how to raise that event.:(( Any Idea??