' Look for WM_MENUSELECT.
Public Function NewWindowProc(ByVal hwnd As Long, ByVal msg _
As Long, ByVal wParam As Long, ByVal lParam As Long) As _
Long
Const WM_MENUSELECT = &H11F
Dim menu_id As Long
Dim menu_caption As String
Dim length As Long
If msg = WM_MENUSELECT Then
' Get the menu ID.
menu_id = (wParam And &HFFFF&)
' Get the menu caption.
menu_caption = Space$(1024)
length = GetMenuString(lParam, menu_id, _
menu_caption, _
Len(menu_caption), 0)
menu_caption = Left$(menu_caption, length)
Form1.ShowMenuTip menu_caption
End If
' Invoke the old menu proc.
NewWindowProc = CallWindowProc( _
OldWindowProc, hwnd, msg, wParam, _
lParam)
End Function
|