Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically click and move mouse with VB.NET

I want to build a program in VB .net that will allow me to control my pc with my laptop. The only question I really have is, how can I programmatically click without using some kind of click event, say if I want to click the start orb and my mouse is at that exact location, I'd like a sub or something that will click on it. Right now I only know how to click within the form.

Thanks

like image 883
jmasterx Avatar asked Aug 10 '09 14:08

jmasterx


1 Answers

You can set the Cursor position with the property Cursor.Position.

You will need to P/Invoke mouse_event in user32.dll in order to simulate the mouse click.

Sample code in C# is here: http://www.gamedev.net/community/forums/topic.asp?topic_id=321029

like image 119
Nick Avatar answered Nov 22 '22 07:11

Nick