IConsoleVerb::GetVerbState

[This is preliminary documentation and subject to change.]

Enables a snap-in to obtain a given verb's current button state.

HRESULT GetVerbState(
  MMC_CONSOLE_VERB m_eCmdID,  // Command identifier of the verb
  MMC_BUTTON_STATE nState,  // State of the verb.
  BOOL * pState             // Pointer to information returned.
);
 

Parameters

m_eCmdID
[in] Specifies the command identifier of the verb. Taken from the MMC_CONSOLE_VERB enumeration, this value can be one of the following:
Value Meaning
MMC_VERB_CUT Enables an item that can be selected to be copied to the clipboard and removed. Implemented by the user.
MMC_VERB_COPY Enables the selected item that can be selected to be copied to the clipboard. Implemented by the user.
MMC_VERB_PASTE Enables the selected item that have been cut or copied to be pasted into the result pane. Implemented by the user.
MMC_VERB_DELETE Enables the selected item to be deleted. Implemented by the console. A notification will be sent to the snap-in that owns that item.
MMC_VERB_PROPERTIES The console asks the snap-in and all snap-in extensions to provide property pages for the currently selected item. Implemented by the console.
MMC_VERB_RENAME Enables the selected item to be renamed. Implemented by the console.
MMC_VERB_REFRESH Determines whether the currently selected scope item (folder) can be refreshed. Implemented by the user.
MMC_VERB_PRINT Determines whether the currently selected item can be printed. Implemented by the user.

nState
[in] Identifies the possible states of the button. Taken from the MMC_BUTTON_STATE enumeration, this value can be one of the following:
Value Meaning
ENABLED Enables the menu item so it can be selected and restores it from its grayed state.
HIDDEN Hides the button in the toolbar or item in the menu.

pState
[out] Pointer to the state information returned. TRUE if the state is enabled or hidden and FALSE if the state is disabled or visible.

Return Values

S_OK
The verb was successfully obtained.
E_FAIL
An error occurred. Do not trust the value in pState.

Remarks

Every time an item is selected, the verb states for all the commands are returned to disabled and visible. It is up to the snap-in developer to update the verb state every time an item is selected.

See Also

IToolbar