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
| Name | Type | Description |
|---|---|---|
| Events | ICommandsEvents | Returns the event registering interface of the ICommands interface. |
Methods
| Name | Description |
|---|---|
| AddCustomCommandToMenu | Adds existing custom command to the specified context menu location. |
| CreateCustomCommand | Creates a custom command that can be added to the application toolbar or to the contextmenu. |
| CreateSubMenuItem | Creates a new SubMenu for already created Menu. |
| CreateTaskbarGroup | Creates new custom task bar group for custom commands. 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). To share a custom task bar group between multiple applications, use the same name when creating the group. The group is then shared between applications and each application can add its own commands to the shared group. When an application is uninstalled or removes the group, the group remains available for other applications using it. Supported in M-Files Client version 25.10 and later. |
| DeleteCustomCommand | Deletes a custom command. The command is automatically removed. |
| ExecuteCommand | Executes a user command. |
| GetCommandName | Resolves the name that has been associated with the given command id. |
| GetCommandState | Gets the command state for builtin or custom command in specified location. |
| GetMenuIdOfBuiltInCommand | Gets the MenuItem ID of a built-in command by its command ID and location. |
| RemoveCustomCommandFromMenu | Removes a custom command from the specified menu location. |
| RemoveMenuItem | Removes menuitem from the menu. |
| RemoveTaskbarGroup | Removes custom task bar group from the task bar. NOTE: If the group is shared between multiple applications, it is only removed for the calling application meaning that its commands are removed from the group and the group is no longer available to the calling application. The group remains available for other applications using it. If the group is not shared, it is removed completely. Supported in M-Files Client version 25.10 and later. |
| SetCommandState | Sets 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. |
| SetIcon | Sets the icon for a custom command. Supported in M-Files Client version 25.10 and later. |
| SetMenuItemState | Sets the MenuItem state individually. |
| SetTaskbarGroupIcon | Sets the icon for a custom task bar group. Supported in M-Files Client version 25.10 and later. |