Skip to main content

When it is launched

The event occurs when calling a user command (provided that a corresponding item is added to the main menu or on the toolbar). User command identifiers can be represented in the form of CI_UserCommand + <non-negative integer>.

Parameters

To add a user command to the main menu or on the toolbar, you must use AppendItem / InsertItem and AppendButton /InsertButton methods of the IMenu interface and the IToolbar interface respectively. The command identifiers CI_UserCommand or CI_UserCommand + <non-negative integer> must be used.
The sample code below demonstrates how to add a menu item for a user command with a command identifier CI_UserCommand + 1.
A toolbar button or a menu item added for a user command will be disabled unless a handler of the On User Command event is added. The sample code below demonstrates processing the On User Command event.