Skip to main content


The Commands API includes functionality for creating Custom Commands and menus.

See the Samples for more examples of how to create custom commands and menus.


EventsIEventsReturns the event registering interface of the ICommands interface.


AddCustomCommandToMenuAdds existing custom command to the specified context menu location.
CreateCustomCommandCreates a custom command that can be added to the application toolbar or to the contextmenu.
CreateSubMenuItemCreates a new SubMenu for already created Menu.
DeleteCustomCommandDeletes a custom command. The command is automatically removed.
ExecuteCommandExecutes a user command.
GetCommandNameResolves the name that has been associated with the given command id.
GetCommandStateGets the command state for builtin or custom command in specified location.
RemoveCustomCommandFromMenuRemoves a custom command from the specified menu location.
RemoveMenuItemRemoves menuitem from the menu.
SetCommandStateSets the command's state to be hidden, visible, enabled or disabled. Calling
this method may affect context menu, application toolbar, menus or all of them.
SetMenuItemStateSets the MenuItem state individually.