IMenuButton::AddButton method (mmc.h)

The IMenuButton::AddButton method enables a user to add a button to the MMC menu bar for a particular view.

Syntax

HRESULT AddButton(
  [in] int      idCommand,
  [in] LPOLESTR lpButtonText,
  [in] LPOLESTR lpTooltipText
);

Parameters

[in] idCommand

A value that specifies a user-supplied value that uniquely identifies the button to be added to the menu bar.

[in] lpButtonText

A pointer to the text value (a null-terminated string) to be displayed on the button.

[in] lpTooltipText

A pointer to the text value (a null-terminated string) to be displayed when the user places the mouse pointer on the button.

Return value

This method can return one of these values.

Remarks

Buttons added to the MMC menu bar for a particular view are always appended to the buttons already present. The initial state of any menu button is hidden and disabled.

When the snap-in loses the focus, these buttons are automatically removed from the menu bar. As a result, they must be added each time the snap-in gets the focus.

This method can be called by primary or extension snap-ins.

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

IMenuButton