Jump to content

MM QUERYITEMTEXT: Difference between revisions

From EDM2
Created page with "{{DISPLAYTITLE:MM_QUERYITEMTEXT}} This message returns the text of the specified menu item. ==Syntax== <pre> param1 USHORT usitem; Item identifier.: SHORT smaxcount; Maximum count.: param2 PSZ pszItemText; Buffer into which the item text is to be copied.: </pre> ==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 ::..."
 
Ak120 (talk | contribs)
mNo edit summary
 
Line 5: Line 5:
<pre>
<pre>
param1
param1
USHORT usitem;     /* Item identifier. */
USHORT usitem;     /* Item identifier. */
SHORT smaxcount;  /* Maximum count. */
SHORT smaxcount;  /* Maximum count. */


Line 15: Line 15:
;usitem ([[USHORT]]) - input: Item identifier.
;usitem ([[USHORT]]) - input: Item identifier.
;smaxcount ([[SHORT]]) - input: Maximum count.
;smaxcount ([[SHORT]]) - input: Maximum count.
::Copy the item text as a null-terminated string, but limit the number of
: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.
::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.
;pszItemText (PSZ) - input: Buffer into which the item text is to be copied.
::This points to a string (character) buffer.
:This points to a string (character) buffer.


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


==Remarks==
==Remarks==
The menu control window procedure responds to this message by copying up to '''
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'''.
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_
The length of the item text can be determined by using the [[MM_QUERYITEMTEXTLENGTH]] message.
QUERYITEMTEXTLENGTH]] message.


==Default Processing==
==Default Processing==
The default window procedure does not expect to receive this message and
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.
therefore takes no action on it, other than to set '''sTextLength''' to the default value of 0.


[[Category:Messages]]
[[Category:Messages]]

Latest revision as of 03:09, 18 May 2025

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.