IApplication::AddCommandBarButton

This method creates a toolbar and toolbar buttons for an add-in.

HRESULT AddCommandBarButton(
  long nButtonType,
  BSTR szCmdName,
  long dwCookie
);

Parameters

  • nButtonType
    [in] The button type. The following table shows the possible values for nButtonType.
    Value Description
    dsGlyph Requires that the button display only an image.
    dsText Requires that the button display only button text.
  • szCmdName
    [in] The name of the command the button will carry out. This name must match the name added by the IApplication method.
  • dwCookie
    [in] The identifier of the add-in, passed through the IDSAddIn::OnConnection method.

Return Values

None.

Remarks

Only add-ins can call the AddCommandBarButton method. VBScript macros cannot.

Requirements

OS Versions: Windows CE .NET 4.1 and later.
Header: Appdefs.h.
Link Library: Import type library from Devshl.dll.

See Also

Macros and Add-ins | New Commands and Toolbar Buttons | IApplication::EnableModeless | IApplication::SetAddInInfo | IDSAddIn::OnConnection

 Last updated on Friday, October 08, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.