Click here to Skip to main content
15,885,141 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.
Posted
Comments
Sergey Alexandrovich Kryukov 25-Oct-11 2:32am    
Not clear what do you mean "send mouse click"? Simulate it, as Prerak assumed, or what?
--SA

If this is simulation of mouse input, you need to use P/Invoke and raw Windows API SendInput, see http://msdn.microsoft.com/en-us/library/windows/desktop/ms646310%28v=vs.85%29.aspx[^], http://pinvoke.net/default.aspx/user32.sendinput[^].

The function mouse_event was superseded by SendInput, so better use SendInput (http://msdn.microsoft.com/en-us/library/windows/desktop/ms646260%28v=vs.85%29.aspx[^]).

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).

—SA
 
Share this answer
 
 
Share this answer
 
Comments
[no name] 25-Oct-11 2:32am    
Is there any way to do without using api? ie. by using vb.net 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.
--SA
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.
--SA
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.
--SA

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