Share via


How Add-ins Add Commands, Toolbar Buttons, and Key Sequences

Home Page (Add-ins)OverviewHow Do I ... TopicsFAQReference

While connecting to the Visual C++ Developer Studio environment, an add-in adds its commands to the environment. Optionally, the add-in can add toolbar buttons and key sequences for carrying out these commands.

The following table summarizes how an add-in adds commands, toolbar buttons, and key sequences.

To add An add-in calls
A command The AddCommand method
A toolbar button The AddCommandBarButton method
A key sequence (key binding) The AddKeyBinding method

Caution   Unless key sequences are necessary, do not add them because they might replace existing ones. For example, if a keystroke is assigned to a command and you assign the same keystroke to another command, your new assignment replaces the original. For best results, let the user assign key sequences to the commands added by an add-in.

See Also   Adding Commands to the Visual C++ Developer Studio, Creating Toolbar Buttons for Add-in Commands Programmatically, Assigning Key Sequences to Add-in Commands Programmatically