Jump to content

MM_QUERYITEMTEXT

From EDM2

This message returns the text of the specified menu item.

Syntax

param1
USHORT usitem;     /* Item identifier. */
SHORT smaxcount;   /* Maximum count. */

param2
PSZ pszItemText;   /* Buffer into which the item text is to be copied. */

Parameters

usitem (USHORT) - input
Item identifier.
smaxcount (SHORT) - input
Maximum count.
Copy the item text as a null-terminated string, but limit the number of characters copied, including the null termination character, to this value, which must be greater than 0.
pszItemText (PSZ) - input
Buffer into which the item text is to be copied.
This points to a string (character) buffer.

Returns

sTextLength (SHORT) - return
Length of item text.
The length of the text string, excluding the null termination character.
0: Error occurred. For example, no item of the specified identity exists or the item has no text. No text is copied.
Other: Length of item text.

Remarks

The menu control window procedure responds to this message by copying up to smaxcount characters as a null-terminated string from the text of the item specified by usitem, if it has the style MIS_TEXT, into the buffer specified by pszItemText.

The length of the item text can be determined by using the MM_QUERYITEMTEXTLENGTH message.

Default Processing

The default window procedure does not expect to receive this message and therefore takes no action on it, other than to set sTextLength to the default value of 0.