Click here to Skip to main content
15,615,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to send mouse click(left click)within form. I've managed to move mouse pointer and only needed to click it.
Sergey Alexandrovich Kryukov 25-Oct-11 2:32am    
Not clear what do you mean "send mouse click"? Simulate it, as Prerak assumed, or what?

If this is simulation of mouse input, you need to use P/Invoke and raw Windows API SendInput, see[^],[^].

The function mouse_event was superseded by SendInput, so better use SendInput ([^]).

This function is low-level, it works like an input triggered by hardware (in fact, from what I know, real hardware event triggers one these functions).

Share this answer
Share this answer
[no name] 25-Oct-11 2:32am    
Is there any way to do without using api? ie. by using built in functions.
Sergey Alexandrovich Kryukov 25-Oct-11 2:43am    
I don't think so. You can only simulate keyboard input with System.Windows.Forms.SendKeys, with very limited functionality.
Sergey Alexandrovich Kryukov 25-Oct-11 2:41am    
I voted 4. This answer is about mouse_event, but this function was superseded by SendInput.

I also provided a link with P/Invoke code, please see my solution.
Prerak Patel 25-Oct-11 2:48am    
Yes, I checked that. My 5 there... :)
Sergey Alexandrovich Kryukov 25-Oct-11 2:52am    
Thank you, Prerak.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900