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.
LM_INSERTITEM(1.2)
Message Group  Overview                           Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINLISTBOXES
 
LM_INSERTITEM
mp1 = MPFROMSHORT((SHORT) iItem);    /* item index                */
mp2 = MPFROMP((PSZ) pszText);        /* pointer to text to insert */
 
An application sends an LM_INSERTITEM message to insert an item into a
list-box control. The actual placement of the item is determined by the
iItem parameter.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
iItem      Low word of mp1. Specifies the index of the item. This parameter
           can be a zero-based index or one of the following values:
 
           Value               Meaning
           ─────────────────────────────────────────────────────────────────
           LIT_END             The item is to be added to the end of the
                               list.
 
           LIT_SORTASCENDING   The item is to be added to the list sorted in
                               ascending order.
 
           LIT_SORTDESCENDING  The item is to be added to the list sorted in
                               descending order.
 
pszText    Low and high word of mp2. Points to the text to insert.
 
Return Value
 
The return value is the actual position of the item if it was successfully
inserted. The return value is LIT_MEMERROR if the list-box control cannot
allocate space to insert the item in the specified position. Otherwise, the
return value is LIT_ERROR, indicating an error occurred.
 
See Also
 
LM_DELETEITEM