RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TMenu.DoGetMenuString Method

Returns the caption for an item in the menu.

Pascal
function DoGetMenuString(Menu: HMENU; ItemID: UINT; Str: PChar; MaxCount: Integer; Flag: UINT): Integer;
C++
__fastcall int DoGetMenuString(HMENU Menu, UINT ItemID, const char * Str, int MaxCount, UINT Flag);

DoGetMenuString is used internally to obtain menu item captions, given the Windows menu handle. The Menu parameter indicates the menu's handle. The ItemID parameter specifies the menu item whose caption is desired. If the Flag parameter is MF_BYCOMMAND, ItemID is the Command property of the menu item. If Flag is MF_BYPOSITION, ItemID is the 0-based index of the menu item. The caption is returned in a buffer pointed to by the Str parameter. MaxCount indicates the size of that buffer. 

Unlike the Windows API function GetMenuString, DoGetMenuString returns the correct caption for owner-draw menu items. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!