DETECTION CLICK SOURIS

cs_zaky Messages postés 7 Date d'inscription lundi 13 mai 2002 Statut Membre Dernière intervention 27 janvier 2003 - 13 mai 2002 à 19:26
cs_stephen Messages postés 2 Date d'inscription vendredi 26 avril 2002 Statut Membre Dernière intervention 16 mai 2002 - 16 mai 2002 à 10:56
Salut,

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.

C'est urgent,
Merci.

2 réponses

cs_stephen Messages postés 2 Date d'inscription vendredi 26 avril 2002 Statut Membre Dernière intervention 16 mai 2002
16 mai 2002 à 10:56
ET SANS TIMER COMMENT CA MARCHE ???
0
cs_Pyros Messages postés 23 Date d'inscription dimanche 12 août 2001 Statut Membre Dernière intervention 24 décembre 2003
13 mai 2002 à 21:07
tu cre un timer

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

:approve)
-1
Rejoignez-nous