Pour une appli VB 6 standard, je recherche une fonction (API ou pas) qui me permette de détecter un click de souris et me renvoie la position de la souris relativement à une Form.
Private Declare Function GetAsyncKeyState Lib "User32" (ByVal uAction As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Type POINTAPI
x As Long
y As Long
End Type
Dim Pos As POINTAPI
Private Sub Timer_Timer() 'interval 100
Key = GetAsyncKeyState(i)
if i = 1 then msgbox "leftclick"
if i = 2 then msgbox "rightclick"
if i = 3 then msgbox "centerclick"
GetCursorPos Pos 'met les positions de la souris Position.Caption = Pos.x & " ; " & Pos.y 'affiche la pos
End Sub