XPLMAppendMenuItem

XPLM_API int        XPLMAppendMenuItem(
                         XPLMMenuID           inMenu,    
                         const char *         inItemName,    
                         void *               inItemRef,    
                         int                  inDeprecatedAndIgnored);    

This routine appends a new menu item to the bottom of a menu and returns its index. Pass in the menu to add the item to, the items name, and a void * ref for this item.

Returns a negative index if the append failed (due to an invalid parent menu argument).

Note that all menu indices returned are relative to your plugin’s menus only; if your plugin creates two sub-menus in the Plugins menu at different times, it doesn’t matter how many other plugins also create sub-menus of Plugins in the intervening time: your sub-menus will be given menu indices 0 and 1. (The SDK does some work in the back-end to filter out menus that are irrelevant to your plugin in order to deliver this consistency for each plugin.)