template <class character>
int get_menu_string(handle menu,
                    unsigned identity,
                    character* string,
                    int length,
                    unsigned flag)

This function obtains the text of a menu item.


handle menu

The handle of the menu containing the item.

unsigned identity

The identity of the item or its relative position within the menu.

character* string

A pointer to a buffer to hold the text of the menu item.

int length

The length (in characters) of the buffer pointed to by the previous parameter. If zero is specified, the length of the menu item's text is returned.

unsigned flag

menu_item_flag::by_position The parameter identity is the relative position of the item.
menu_item_flag::by_command The parameter identity is the identity of the item. If neither flag is specified, by command is the default.



The number of characters placed in the buffer, not including the null terminator, or the length of the text of the menu item (depending on the input parameters). Zero is returned if the function fails.