how can i get the mouse to click on the position that it is on the screen but for the user not to acually click (my program clicks the mouse for the user).
is this possible and how do i do it?
(i'm sorry if it doesn't make sense)
thanks
Printable View
how can i get the mouse to click on the position that it is on the screen but for the user not to acually click (my program clicks the mouse for the user).
is this possible and how do i do it?
(i'm sorry if it doesn't make sense)
thanks
I believe this code will work.
It makes the mouse button click without having the user do it.
And to move the mouse pointer to where you want to click:Code:Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0&, 0&, 0&, 0&)
Call mouse_event(MOUSEEVENTF_LEFTUP, 0&, 0&, 0&, 0&)
Code:Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Dim t&
t& = SetCursorPos(0, 0)