How can I make a mouse to click on a certain area?
Dekel C.
Use the mouse_event api function. 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 Usage Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0&, 0&, 0&, 0&) Call mouse_event(MOUSEEVENTF_LEFTUP, 0&, 0&, 0&, 0&)
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 Usage Call mouse_event(MOUSEEVENTF_LEFTDOWN, 0&, 0&, 0&, 0&) Call mouse_event(MOUSEEVENTF_LEFTUP, 0&, 0&, 0&, 0&)
And to place the cursor in that certain area you can use the SetCursorPos API: Code: Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long Usage: :) SetCursorPos 400,400 'location Gl, D!m [Edited by Dim on 10-19-2000 at 11:47 PM]
Private Declare Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long Usage: :) SetCursorPos 400,400 'location
Dim
Forum Rules