InsertMenu

Adds a new menu to the Windows Help menu bar.

Syntax

InsertMenu("menu-id", "menu-name", menu-position)

Parameter Description

menu-id Name that Windows Help uses internally to identify the menu. The menu ID must be enclosed in quotation marks. Use this identifier in the AppendItem macro to add menu items (commands) to the menu.
menu-name Name for the menu that Windows Help displays on the menu bar. This name is case sensitive and must be enclosed in quotation marks. Within the quotation marks, place an ampersand (&) before the character you want to use for the menu’s accelerator key.
menu-position Number specifying the position on the menu bar that the new menu name will have. This number must be an integer. Positions are numbered from left to right, with position 0 being the leftmost menu.

Example

The following macro adds a menu named Utilities to Windows Help:

InsertMenu("menu_util", "&Utilities", 3)

Utilities appears as the fourth menu on the Windows Help menu bar, between the Bookmark and Help menus. The user presses ALT+U to open the menu.

Comments

When adding menus, remember that The Windows Interface: An Application Design Guide requires that the File and Edit menus be the first two menus and that the Help menu be the last menu on the menu bar. Therefore, add new menus between the Edit menu and the Help menu.

Be sure that the accelerator key you assign to a menu is unique. If you assign a key that conflicts with another menu accelerator key, Windows Help displays an “Unable to add menu” error message and ignores the macro.

Windows Help ignores this macro if it is executed in a secondary window.

See Also

AppendItem, ChangeItemBinding, CheckItem, DeleteItem, DisableItem, EnableItem, InsertItem, UncheckItem