LM INSERTITEM
Appearance
This message inserts an item into a list box control.
Syntax
param1 SHORT sItemIndex; /* Item index. */ param2 PSZ pszItemText; /* Item text. */
Parameters
- sItemIndex (SHORT) - input
- Item index.
- LIT_END: Add the item to the end of the list.
- LIT_SORTASCENDING: Insert the item into the list sorted in ascending order.
- LIT_SORTDESCENDING: Insert the item into the list sorted in descending order.
- Other: Insert the item into the list at the offset specified by this zero-based index.
- pszItemText (PSZ) - input
- Points to a string containing the item text.
Returns
- sIndexInserted (SHORT) - returns
- Index of inserted item.
- LIT_MEMERROR: The list box control cannot allocate space to insert the list item in the list.
- LIT_ERROR: An error, other than LIT_MEMERROR, occurred.
- Other: The zero-based index of the offset of the item within the list.
Remarks
The list box control window procedure responds to this message by inserting the item text identified by the pszItemText parameter into the position in the list specified by the sItemIndex parameter. The sorting sequence used is that defined by the WinCompareStrings function. The list box control sets sIndexInserted to the zero-based index of the offset of the item within the list.
Default Processing
The default window procedure does not expect to receive this message and therefore takes no action on it, other than to set sIndexInserted to the default value of 0.