Vcl.Menus.TMenu.DoGetMenuString

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function DoGetMenuString(Menu: HMENU; ItemID: UINT; Str: PChar;  MaxCount: Integer; Flag: UINT): Integer;

C++

int __fastcall DoGetMenuString(HMENU Menu, unsigned ItemID, System::WideChar * Str, int MaxCount, unsigned Flag);

Properties

Type Visibility Source Unit Parent
function protected
Vcl.Menus.pas
Vcl.Menus.hpp
Vcl.Menus TMenu

Description

Returns the caption for an item in the menu.

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.

See Also