msgs12.hlp (Topic list)
Important Notice
The pages on this site contain documentation for very old MS-DOS software, purely for historical purposes. If you're looking for up-to-date documentation, particularly for programming, you should not rely on the information found here, as it will be woefully out of date.
MM_QUERYITEMTEXT (1.2)
Message Group  Overview                           Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINMENUS
 
MM_QUERYITEMTEXT
mp1 = MPFROM2SHORT((USHORT) idItem, (SHORT) cchMax);
mp2 = MPFROMP((PSZ) pszText);
 
An application sends an MM_QUERYITEMTEXT message to retrieve the text of a
menu item. The menu item must have the style MIS_TEXT.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
idItem     Low word of mp1. Identifies the menu item with the text.
 
cchMax     High word of mp1. Specifies the maximum number of characters to
           copy from the menu item to the supplied buffer.
 
pszText    Low and high word of mp2. Points to the buffer that receives the
           text from the menu item.
 
Return Value
 
The return value is the length of the string copied. If no text is copied,
the return value is zero (this can result from errors such as an invalid
item identifier or an item with no text).
 
Comments
 
An application can determine the size of the text ahead of time by sending
an MM_QUERYITEMTEXTLENGTH message.
 
See Also
 
MM_QUERYITEMTEXTLENGTH, MM_SETITEMTEXT