Option Explicit
Private Type POINTAPI
X As Long
Y As Long
End Type
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=If]#If[/URL] VBA7 Then
Private Declare PtrSafe Function GetCursorPos Lib "user32.dll" (lpPoint As POINTAPI) As Long
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=Else]#Else[/URL]
Private Declare Function GetCursorPos Lib "user32.dll" (lpPoint As POINTAPI) As Long
[URL=https://www.mrexcel.com/forum/usertag.php?do=list&action=hash&hash=End]#End[/URL] If
Private Sub ListBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim tCurPos As POINTAPI, oiA As IAccessible, vKid As Variant
If Button = 2 Then
GetCursorPos tCurPos
Set oiA = ListBox1
vKid = oiA.accHitTest(tCurPos.X, tCurPos.Y)
ListBox1.Selected(CLng(vKid) - 1) = True
End If
End Sub