◄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 ♦