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