IMenuButton::SetButtonState

[This is preliminary documentation and subject to change.]

Enables a user to change the state of a menu button.

HRESULT SetButtonState(
  int idCommand,           // Specifies the command identifier
  MMC_BUTTON_STATE nState  // Specifies the state of the button
  BOOL bState              // Specifies TRUE or FALSE
);
 

Parameters

idCommand
[in] Specifies a user-supplied value that uniquely identifies the menu button in which the state is being changed.
nState
[in] Specifies the state of the button. This value can be one of the following values taken from the MMC_BUTTON_STATE enumeration:
Value Meaning
ENABLED The button accepts user input. A button that does not have this state does not accept user input and is grayed.
HIDDEN The button is not visible and cannot receive user input.
BUTTONPRESSED The button is being pressed.

bState
[in] Specifies whether the state is to be turned on or off. Set to TRUE to turn the button's state ON; otherwise, set it to FALSE.

Return Values

S_OK
The state of the button was successfully set.
E_UNEXPECTED
An unexpected error occurred.

See Also

IMenuButton