Hi everyone,
I'm trying to get my project to click on a specific area of my form
I need to make the mouse to click the area I want, but I can't figure out
the changes to make to get the mouse click on the area to be clicked on the form.
All I need is one single click on that area which is the left side down corner of the form.
Any help will be nice,
Thanks in advance
I'm trying to get my project to click on a specific area of my form
I need to make the mouse to click the area I want, but I can't figure out
the changes to make to get the mouse click on the area to be clicked on the form.
All I need is one single click on that area which is the left side down corner of the form.
Code:
Public Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
Public Declare Sub mouse_event Lib "user32.dll" (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
Public Const MOUSEEVENTF_RIGHTDOWN = &H8
Public Const MOUSEEVENTF_RIGHTUP = &H10
Public Sub Mouse_LeftClick()
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
End Sub
Public Function CKeyDown() As Boolean
If (GetAsyncKeyState(vbKeyC) And &H8000) Then
CKeyDown = True
Else
CKeyDown = False
End If
End Function
Thanks in advance