Important: The information in this document is obsolete and should not be used for new development.
MenuChoice
If your application needs to find the item number of a disabled menu item that the
user attempted to choose, you can use theMenuChoice
function to return the chosen menu item.
FUNCTION MenuChoice: LongInt;DESCRIPTION
If the user chooses a disabled menu item, theMenuChoice
function returns a value that indicates which menu and menu item the user chose. The high-order word of the function result contains the menu ID of the menu, and the low-order word contains the item number of the menu item chosen by the user.The
MenuChoice
function returns 0 as the low-order word of its function result if the mouse button was released while the cursor was in the menu bar or outside the menu.SPECIAL CONSIDERATIONS
The Menu Manager updates the global variableMenuDisable
whenever a menu is displayed. As the user moves the cursor over each item, the Menu Manager calls the menu definition procedure of the menu to update theMenuDisable
global variable to reflect the current menu ID and menu item. The standard menu definition procedure updates the global variableMenuDisable
appropriately. If your application uses its own menu definition procedure, your menu definition procedure should support this feature; if you use a menu definition procedure that does not update the global variableMenuDisable
appropriately, the result returned byMenuChoice
is undefined.