Skip to main content

ICommands

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.

Properties

NameTypeDescription
EventsICommandsEventsReturns the event registering interface of the ICommands interface.

Methods

NameDescription
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.
CreateTaskbarGroupCreates new custom task bar group for custom commands.

NOTE: Stability is experimental. Non-backward compatible changes or removal may occur in any
future release. Use of this feature is not recommended for production environments.

NOTE: If multiple task bar groups are created for the same MenuLocation with the same
orderPriority, their relative ordering is unspecified and may vary between runs, sessions or
versions. Do not rely on a particular order for groups with equal priority — assign distinct
orderPriority values to guarantee a deterministic ordering (lower values are shown first).
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.
GetMenuIdOfBuiltInCommandGets the MenuItem ID of a built-in command by its command ID and location.
RemoveCustomCommandFromMenuRemoves a custom command from the specified menu location.
RemoveMenuItemRemoves menuitem from the menu.
RemoveTaskbarGroupRemoves custom task bar group from the task bar.

NOTE: Stability is experimental. Non-backward compatible changes or removal may occur in any
future release. Use of this feature is not recommended for production environments.
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.
SetIconSets the icon for a custom command.

NOTE: Stability is experimental. Non-backward compatible changes or removal may occur in any
future release. Use of this feature is not recommended for production environments.
SetMenuItemStateSets the MenuItem state individually.
SetTaskbarGroupIconSets the icon for a custom task bar group.

NOTE: Stability is experimental. Non-backward compatible changes or removal may occur in any
future release. Use of this feature is not recommended for production environments.