IVsUIShell4::SetupToolbar3 Method (IVsWindowFrame^, IVsToolWindowToolbarHost^)

 

Creates a tool bar and also allows routing of commands placed on the toolbar to a specific command target.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop.10.0 (in Microsoft.VisualStudio.Shell.Interop.10.0.dll)

int SetupToolbar3(
	IVsWindowFrame^ pFrame,
	[OutAttribute] IVsToolWindowToolbarHost^% pptwth
)

Parameters

pFrame
Type: Microsoft.VisualStudio.Shell.Interop::IVsWindowFrame^

[in] The window frame for the new toolbar.

pptwth
Type: Microsoft.VisualStudio.Shell.Interop::IVsToolWindowToolbarHost^

[out] Location to return the tool bar hosting interface.

Return Value

Type: System::Int32

Returns S_OK if the tool bar was set up.

This version of the SetupToolbar() method is designed to be used directly with IVsWindowFrame instances. In the new WPF windowing system it is much more convenient to use the IVsWindowFrame interface instead of trying to get the HWND of window. If the IVsWindowFrame object supports the IOleCommandTarget interface, then it will be used as the target for the commands that appear on the toolbars, otherwise the shell's global command target will be used.

Return to top
Show: