Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 21306

[RESOLVED] Click event handler

$
0
0
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.

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

Any help will be nice,
Thanks in advance

Viewing all articles
Browse latest Browse all 21306

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>