Oct 1, 2015 08:20 AM
(This post was last modified: Oct 1, 2015 08:25 AM by Lexxi..)
Hello HF
i tried many ways of mouse click but no luck, tried searching but only found giving coords.
i want a mouse click to happen in the middle of the form so no matter where the form is (top screen, bottom) it will click in the center of the form
Buying BTC for PP, PM me for exchange! @ 10%
DO NOT DEAL WITH THIS MEMBER
If you placed whatever is in the middle of the forum, call its click event instead.
(Oct 1, 2015 08:29 AM)Odus Wrote: If you placed whatever is in the middle of the forum, call its click event instead.
not sure? i dont mean like when mouse clicks, like i need the mouse to click in center of browser or form(same thing)
Buying BTC for PP, PM me for exchange! @ 10%
DO NOT DEAL WITH THIS MEMBER
(Oct 1, 2015 08:32 AM)Lexxi. Wrote: not sure? i dont mean like when mouse clicks, like i need the mouse to click in center of browser or form(same thing)
There was no mention of a browser in the OP. Instead of clicking the control, get the button or whatever on the web page it is' ID then invoke a click on it.
(Oct 1, 2015 08:34 AM)Odus Wrote: There was no mention of a browser in the OP. Instead of clicking the control, get the button or whatever on the web page it is' ID then invoke a click on it.
haha, thats what i use for buttons but this one doesnt have a button, its a game, when i inspect element outside it (the page) it gives element id but not for game only gives java options
Buying BTC for PP, PM me for exchange! @ 10%
DO NOT DEAL WITH THIS MEMBER
Make a new Point and divide the form width and height by 2, then invoke a mouseclick on that Point
Code Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
Sub MouseClickCenter()
Dim x As Integer = CInt(Me.Left + (Me.Width / 2))
Dim y As Integer = CInt(Me.Top + (Me.Height / 2))
Cursor.Position = New Point(x, y)
mouse_event(&H2, 0, 0, 0, 0)
mouse_event(&H4, 0, 0, 0, 0)
End Sub
i have made you this code try it 🤝
Oct 1, 2015 08:56 AM
(This post was last modified: Oct 1, 2015 08:56 AM by Lexxi..)
(Oct 1, 2015 08:48 AM)bho007 Wrote: Code Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)
Sub MouseClickCenter()
Dim x As Integer = CInt(Me.Left + (Me.Width / 2))
Dim y As Integer = CInt(Me.Top + (Me.Height / 2))
Cursor.Position = New Point(x, y)
mouse_event(&H2, 0, 0, 0, 0)
mouse_event(&H4, 0, 0, 0, 0)
End Sub
i have made you this code try it 🤝
thanks alot, i had this code, my bad should of just use the me.width/2)) at end of it, thanks though
Thread closed- thanks for the code again :)
Buying BTC for PP, PM me for exchange! @ 10%
|