MartinLiss
Nov 14th, 2003, 06:51 PM
This project demonstrates the display of menu item descriptions when a menu item is highlighted. It uses message hooking.
Note: If you have accelerators (eg. & ) in your menu text and/or shortcuts (eg. Ctrl+N) then the GetDescription function in the app needs to be modified as shown below.
Private Function GetDescription(MenuCaption As String) As String
'Determine the description of the menu item.
Select Case MenuCaption
Case "&New" & vbTab & "Ctrl+N"
GetDescription = "Creates a new document"
Case "Open"
GetDescription = "Opens a Document"
Case "Close"
GetDescription = "Closes Document"
Case "Cut"
GetDescription = "Cuts Selection to Clipboard"
Case "Copy"
GetDescription = "Copies Selection to Clipboard"
Case "Paste"
GetDescription = "Pastes Contents of Clipboard"
Case "Normal"
GetDescription = "Regular Paste"
Case "Special"
GetDescription = "Special Paste"
Case Else
GetDescription = ""
End Select
End Function
Note: If you have accelerators (eg. & ) in your menu text and/or shortcuts (eg. Ctrl+N) then the GetDescription function in the app needs to be modified as shown below.
Private Function GetDescription(MenuCaption As String) As String
'Determine the description of the menu item.
Select Case MenuCaption
Case "&New" & vbTab & "Ctrl+N"
GetDescription = "Creates a new document"
Case "Open"
GetDescription = "Opens a Document"
Case "Close"
GetDescription = "Closes Document"
Case "Cut"
GetDescription = "Cuts Selection to Clipboard"
Case "Copy"
GetDescription = "Copies Selection to Clipboard"
Case "Paste"
GetDescription = "Pastes Contents of Clipboard"
Case "Normal"
GetDescription = "Regular Paste"
Case "Special"
GetDescription = "Special Paste"
Case Else
GetDescription = ""
End Select
End Function