> ## Documentation Index
> Fetch the complete documentation index at: https://docs.abbyy.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Commands Object (ICommands Interface)

> Commands object (ICommands interface) in ABBYY FineReader Engine Visual Components on Windows — This object provides access to the commands of a Visual Component.

<Warning>
  Visual Components are implemented in FRE for Windows.
</Warning>

This object provides access to the commands of a Visual Component. These commands can appear in the context menu of a component and in its toolbar (if exists). You can enable or disable commands and add custom commands for Visual Components. See [Customizing the Context Menu and Toolbar of a Visual Component](/fine-reader/engine/guided-tour/advanced-techniques/using-gui-elements/customizing-the-context-menu-and-toolbar-of-a-visual-component) or details.

The following Visual Components allow you to manage their commands: [ImageViewer](/fine-reader/engine/visual-components-reference/imageviewer), [ZoomViewer](/fine-reader/engine/visual-components-reference/zoomviewer), [DocumentViewer](/fine-reader/engine/visual-components-reference/documentviewer), [TextEditor](/fine-reader/engine/visual-components-reference/texteditor). See the list of available commands and the ways these commands can be used in each component:

* [Image Viewer commands](/fine-reader/engine/visual-components-reference/imageviewer/image-viewer-commands)
* [Zoom Viewer commands](/fine-reader/engine/visual-components-reference/zoomviewer/zoom-viewer-commands)
* [Document Viewer commands](/fine-reader/engine/visual-components-reference/documentviewer/document-viewer-commands)
* [Text Editor commands](/fine-reader/engine/visual-components-reference/texteditor/text-editor-commands)

The information about executing commands is reported through a special outgoing interfaces. These interfaces are [ICommandEvents](/fine-reader/engine/visual-components-reference/supplementary-objects/icommandevents) (for C++) and a dispinterface [DICommandEvents](/fine-reader/engine/visual-components-reference/supplementary-objects/icommandevents) (for Visual Basic).

It's worth noting that Visual Basic users should not care for details of event interfaces implementation as this development platform provides easy means for handling them. This object may be declared WithEvents in Visual Basic.

For C++ user this fact means that it supports the IConnectionPointContainer interface. To receive notification events, a C++ user should create an object derived from the ICommandEvents interface, then set up the connection between it and events source implemented in Commands object by standard COM means.

## Properties

| Name                                                                                                       | Type                                                                                                              | Description                                                       |
| ---------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------- |
| Count                                                                                                      | [int](/fine-reader/engine/guided-tour/advanced-techniques/programming-aspects/working-with-properties), read-only | Retrieves a number of commands available in the Visual Component. |
| [Element](/fine-reader/engine/visual-components-reference/supplementary-objects/commands/element-property) | [MenuItemEnum](/fine-reader/engine/visual-components-reference/enumerations/menuitemenum), read-only              | Returns the identifier of the command with the specified index.   |

## Methods

| Name                                                                                                                                     | Description                                                         |
| ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| [DisableCommand](/fine-reader/engine/visual-components-reference/supplementary-objects/commands/disablecommand-method)                   | Disables the specified command.                                     |
| [DoCommand](/fine-reader/engine/visual-components-reference/supplementary-objects/commands/docommand-method)                             | Executes the specified command in synchronous or asynchronous mode. |
| [EnableCommand](/fine-reader/engine/visual-components-reference/supplementary-objects/commands/enablecommand-method)                     | Enables the specified command.                                      |
| [HasHotKey](/fine-reader/engine/visual-components-reference/supplementary-objects/commands/hashotkey-method)                             | Specifies whether the hot key is used by some command.              |
| [IsUserCommandRegistered](/fine-reader/engine/visual-components-reference/supplementary-objects/commands/isusercommandregistered-method) | Specifies whether the specified user-defined command is registered. |
| [RegisterUserCommand](/fine-reader/engine/visual-components-reference/supplementary-objects/commands/registerusercommand-method)         | Registers a user-defined command.                                   |
| [UnregisterUserCommand](/fine-reader/engine/visual-components-reference/supplementary-objects/commands/unregisterusercommand-method)     | Cancels the registration of the specified user-defined command.     |

## Samples

This object is used in the following code samples: [VisualComponents](/fine-reader/engine/guided-tour/samples#visualcomponents).

## See also

[IImageViewer::Commands](/fine-reader/engine/visual-components-reference/imageviewer#commands)

[IZoomViewer::Commands](/fine-reader/engine/visual-components-reference/zoomviewer#commands)

[IDocumentViewer::Commands](/fine-reader/engine/visual-components-reference/documentviewer#commands)

[ITextEditor::Commands](/fine-reader/engine/visual-components-reference/texteditor#commands)

[ICommandEvents](/fine-reader/engine/visual-components-reference/supplementary-objects/icommandevents)

[Customizing the Context Menu and Toolbar of a Visual Component](/fine-reader/engine/guided-tour/advanced-techniques/using-gui-elements/customizing-the-context-menu-and-toolbar-of-a-visual-component)
