Private Sub File1_Click()
    'Display the currently selected item to user
    MsgBox ("The currently selected item is: ") + File1.List(File1.ListIndex)
    End Sub

Private Sub File1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    Dim ItemIndex As Long
    
    Dim AtThisPoint As POINTAPI
    'Convert the File ListBox client twip coordinates
    'to screen pixel coordinates
    AtThisPoint.X = X \ Screen.TwipsPerPixelX
    AtThisPoint.Y = Y \ Screen.TwipsPerPixelY
    Call ClientToScreen(File1.hWnd, AtThisPoint)
    
    'Get the zero-based index of the item under the cursor
    ItemIndex = LBItemFromPt(File1.hWnd, AtThisPoint.X, AtThisPoint.Y, False)
    'Select the item if it is not already selected
    If ItemIndex <> SendMessage(File1.hWnd, LB_GETCURSEL, 0, 0) Then
        Call SendMessage(File1.hWnd, LB_SETCURSEL, ItemIndex, 0)
    End If
End Sub


In a moduble.bas:

Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Declare Function ClientToScreen Lib "user32" (ByVal hWnd As Long, lpPoint As POINTAPI) As Long
Declare Function LBItemFromPt Lib "comctl32.dll" (ByVal hLB As Long, ByVal ptX As Long, ByVal ptY As Long, ByVal bAutoScroll As Long) As Long

Public Const LB_SETCURSEL = &H186
Public Const LB_GETCURSEL = &H188

Type POINTAPI
    X As Long
    Y As Long
End Type
