IToolbar::SetButtonState method (mmc.h)

The IToolbar::SetButtonState method enables a snap-in to set an attribute of a button.

Syntax

HRESULT SetButtonState(
  [in] int              idCommand,
  [in] MMC_BUTTON_STATE nState,
  [in] BOOL             bState
);

Parameters

[in] idCommand

A unique value that the snap-in has associated with a button using the InsertButton or AddButtons method using the MMCBUTTON structure.

[in] nState

A value that specifies the state to be set for the button. Can be any one of the following:

ENABLED

The button accepts user input. A button that does not have this state does not accept user input and appears dimmed.

CHECKED

The button has the CHECKED style and is being pressed.

HIDDEN

The button is not visible and cannot receive user input.

INDETERMINATE

The button appears dimmed.

BUTTONPRESSED

The button is being pressed.

[in] bState

A value that specifies whether the state identified in nState is set to TRUE or FALSE. TRUE sets the button state to the state identified by nState and FALSE clears the state (if it is already set).

Return value

This method can return one of these values.

Remarks

Snap-ins should not set button states until the toolbar has been attached using IControlbar::Attach.

Requirements

Requirement Value
Minimum supported client Windows Vista
Minimum supported server Windows Server 2008
Target Platform Windows
Header mmc.h
DLL Mmcndmgr.dll

See also

IToolbar