Programmatically click and move mouse with VB.NET

混江龙づ霸主 提交于 2019-11-27 16:48:10

问题


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


回答1:


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




回答2:


Found it :-p thanks anyways http://www.dreamincode.net/forums/showtopic67915.htm



来源:https://stackoverflow.com/questions/1255364/programmatically-click-and-move-mouse-with-vb-net

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!