on the screen programmatically??? If i wanted when you press a button the mouse to change position to X=0,Y=0 of the hole screen/desktop not the window of the form how can i do it?
(using VB.NET)...
Sub1:
How can i "MouseRightClick" programmatically?
Sub2:
How can i "MouseLeftClick" programmatically?
All I want to do is have the mouse button click. The exact same as if you click the mouse yourself, but do it with code instead of a finger.
Can someone perfect this code plz:
DeclareSub mouse_event Lib "user32" Alias "mouse_event" (ByVal dwFlags AsLong, ByVal dx AsLong, ByVal dy AsLong, ByVal cButtons AsLong, ByVal dwExtraInfo AsLong) PrivateSub MyMethod() Windows.Forms.Cursor.Current.Position = New System.Drawing.Point(225, 105) mouse_event(&H2, 0, 0, 0, 1) EndSub
From a post:
Quote
This would allow you to set the cursor position and perform a left mouse click. The different mouse click options (right click, left click, etc.) are controlled by the first parameter of the function. In this case &H2 programatically implements a left mouse down at the x-y position 225,105. Other mouse events may be implemented using these:
&H1 is a mouse move
&H2 is left mouse button down
&H4 is left mouse button up
&H8 is right mouse button up
&H10 is right mouse button down
&H20 is middle mouse button down
&H40 is middle mouse button up
&H1 is a mouse move
&H2 is left mouse button down
&H4 is left mouse button up
&H8 is right mouse button up
&H10 is right mouse button down
&H20 is middle mouse button down
&H40 is middle mouse button up
Sub3:
How can i press lets say ")" or "q" or "ALT+F4" programmatically?
Using the keyboard this time...
(and i dont forget to say thanks
This post has been edited by NIXZ: 22 September 2009 - 02:11 PM

New Topic/Question
Reply
MultiQuote







|