GetCommandState
Description
Gets the command state for builtin or custom command in specified location.
Syntax
// shellFrame points here into the IShellFrame interface
const result = await shellFrame.Commands.GetCommandState(
  command,
  location,
  includeBuiltInState,
  includeScriptSpecifiedState,
);
Parameters
| Name | Optionality | Type | Description | 
|---|---|---|---|
| command | Required | number | The command id. Can be a builtin command enumerated value or custom command id. | 
| location | Required | CommandLocation | Detailed command location to examine. Possible locations are enumerated. | 
| includeBuiltInState | Required | boolean | If true, takes the built-in state of the command into account. | 
| includeScriptSpecifiedState | Required | boolean | If true, accounts for the script-specified state of the command. | 
Possible values for the command location are:
| Name | Value | Description | 
|---|---|---|
Undefined | 0 | Undefined value. | 
MainMenu | 1 | Specifies the command appearance in the main menus, such as top menu and command bars. | 
ContextMenu | 2 | Specifies the command appearance in the context menu. | 
ActivityContextMenu | 6 | Specifies the command appearance in the activity context menu. | 
TaskBar | 7 | Specifies the command appearance on 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.  | 
All | 268435455 | Refers to all command locations.  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.  | 
Return type
| Type | Description | 
|---|---|
| Promise < CommandState > | The command state. |