Retrieving Handles to Menus and SubmenusLast reviewed: November 2, 1995Article ID: Q67688 |
The information in this article applies to:
To change the contents of a menu, you must have its handle. The handle of the menu associated with a given window is available through the GetMenu() function. To obtain a reference to a particular text item in the menu, use the GetMenuString() function. The definition for this function is
GetMenuString(hMenu, wIDItem, lpString, nMaxCount, wFlag)where
hMenu = The menu handle wIDItem = The ID of the item or the zero-based offset of the item within the menu lpString = The buffer that is to receive the text nMaxCount = The length of the buffer wFlag = MF_BYCOMMAND or MF_BYPOSITIONIf a menu item has a mnemonic, the text will contain an ampersand (&) character preceding the mnemonic character. To obtain the handle to a submenu of the menu bar, use the GetSubMenu() function. The second parameter, nPos, is the zero-based offset from the beginning of the menu.
|
Additional reference words: 3.00 3.10 3.50 3.51 4.00 95
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |