IVsButtonBar::Attach Method (IntPtr, Int32, IntPtr, IVsButtonBarClient^)

 

Creates window/button combinations.

Namespace:   Microsoft.VisualStudio.TextManager.Interop
Assembly:  Microsoft.VisualStudio.TextManager.Interop (in Microsoft.VisualStudio.TextManager.Interop.dll)

int Attach(
	IntPtr hwndParent,
	int cButtons,
	IntPtr hImageList,
	IVsButtonBarClient^ pClient
)

Parameters

hwndParent
Type: System::IntPtr

[in] Handle to the parent window.

cButtons
Type: System::Int32

[in] Number of buttons in the button bar.

hImageList
Type: System::IntPtr

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

pClient
Type: Microsoft.VisualStudio.TextManager.Interop::IVsButtonBarClient^

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

Return Value

Type: System::Int32

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

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.

Return to top
Show: