InsertMenu
MenuHandle theMenu ; handle of a menu to insert into the menu bar short beforeID ; 0=at end of list; else is where to put menu
This places a menu into the menu list at a specified position or after all other
menus, or prepares a popup menu.
leads to a variable-length MenuInfo structure. beforeID specifies where to put the menu in the menu list; it is a menuID
value from a previous call to NewMenu or the ID of a resource read via GetMenu. Use beforeID =0 to put the menu at the end of the list (the rightmost position on the menu bar).
Use beforeID = hierMenu (-1) to place a menu in the hierarchical portion of the menu list, for use as a popup menu (see
Notes: This is the normal way to install a prepared menu (obtained via GetMenu Note that after inserting the menu, it is still OK to insert or append items
to the individual menus; however, most applications tend to prepare the
menus before inserting them.
An alternative to this is to read and install a prepared menu list resource
You may store any reasonable number of menus into the hierarchical
portion of the menu list by using beforeID = -1; then use them as popup
(SetItemCmd). Be careful about assigning command-key equivalents to popup menus and submenus since they will be searched (even when not
attached or not visible) upon calls to MenuKey.