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_INSERTITEM (1.2)
Message Group  Overview                           Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_WINMENUS
 
MM_INSERTITEM
mp1 = (MPARAM) pmi;              /* pointer to MENUITEM structure */
mp2 = MPFROMP((PSZ) pszText);    /* pointer to text               */
 
An application sends an MM_INSERTITEM message to insert a menu item. The
item pointed to by the pmi parameter is inserted into the menu list at the
position specified by the item index (contained within the MENUITEM
structure). If the item index is MIT_END, the item is added to the end of
the list. If the style of the item includes MIS_TEXT, the text of the item
is pointed to by the pszText parameter.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
pmi        Low and high word of mp1. Points to a MENUITEM structure.
 
pszText    Low and high word of mp2. Points to the text for the menu item.
 
Return Value
 
The return value is the actual position of the item if the item was inserted
successfully. The return value is MIT_MEMERROR if the control cannot
allocate space to insert the item in the menu. The return value is MIT_ERROR
if the iPosition field of the MENUITEM structure is invalid.
 
See Also
 
MENUITEM, MM_DELETEITEM