Skip to main content

When it is launched

The event occurs when a user command is called, provided that a corresponding item is added to the main menu or the toolbar. User command identifiers have the form CI_UserCommand + <non-negative integer>.

Parameters

To add a user command to the main menu or the toolbar, use the AppendItem or InsertItem and AppendButton or InsertButton methods of the IMenu and IToolbar interfaces respectively. Use the command identifier CI_UserCommand or CI_UserCommand + <non-negative integer>. The following sample code adds a menu item for a user command with the command identifier CI_UserCommand + 1.
A toolbar button or menu item added for a user command is disabled unless a handler for the On User Command event is added. The following sample code processes the On User Command event.