Partager via


IVsButtonBar.Attach(IntPtr, Int32, IntPtr, IVsButtonBarClient) Method

Definition

Creates window/button combinations.

public:
 int Attach(IntPtr hwndParent, int cButtons, IntPtr hImageList, Microsoft::VisualStudio::TextManager::Interop::IVsButtonBarClient ^ pClient);
public int Attach (IntPtr hwndParent, int cButtons, IntPtr hImageList, Microsoft.VisualStudio.TextManager.Interop.IVsButtonBarClient pClient);
abstract member Attach : nativeint * int * nativeint * Microsoft.VisualStudio.TextManager.Interop.IVsButtonBarClient -> int
Public Function Attach (hwndParent As IntPtr, cButtons As Integer, hImageList As IntPtr, pClient As IVsButtonBarClient) As Integer

Parameters

hwndParent
IntPtr

nativeint

[in] Handle to the parent window.

cButtons
Int32

[in] Number of buttons in the button bar.

hImageList
IntPtr

nativeint

[in] Handle to an image list containing the button images.

pClient
IVsButtonBarClient

[in] Pointer to the client for the button bar.

Returns

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

Remarks

COM Signature

From textmgr2.idl:

HRESULT IVsButtonBar::Attach(  
   [in] HWND hwndParent,  
   [in] long cButtons,  
   [in] HANDLE hImageList,  
   [in] IVsButtonBarClient *pClient  
);  

Attach is called by AddButtonBar. Attach creates the window and Button combos and sets up a link between the Button bar and its client. Do not call this function unless you are bypassing IVsButtonBarManager. Each bmp in the image list MUST be 16x16.

Applies to