This documentation is archived and is not being maintained.

IVsPackageDynamicToolOwnerEx Interface

Enables dynamic control of tool window visibility. This interface extends the IVsPackageDynamicToolOwner interface by adding a parameter for the multi-instance ID. This version controls the number of instances that are shown, while the previous version controls only the kind of tool window that is shown, regardless of its instance ID.

This primarily affects tool windows that have the CTW_fForceCreate flag that causes them to be loaded by the shell on startup or when the context is changed.

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

public interface IVsPackageDynamicToolOwnerEx

The IVsPackageDynamicToolOwnerEx type exposes the following members.

Public methodQueryShowToolEnables the VSPackage to control whether to show or hide the tool window. The shell calls this method when the user switches views or contexts, for example Design, Debugging, Full Screen.

The shell calls the QueryShowTool(Guid, UInt32, Int32) method when the user switches window contexts such as debugging or design.

To use this interface, a VSPackage must be registered with a SupportsDynamicToolOwner key. If the registration key SupportsDynamicToolOwner exists on a VSPackage that owns a tool window, the shell loads the package before displaying the tool so that the package can control visibility. Subsequent sessions will not cause the package to be loaded if the tool was not shown again in the previous session, because the window layout is persisted with the window being hidden. Without the SupportsDynamicToolOwner registration, the tool window may be visible initially, since VSPackages are not loaded at startup. To learn more about adding SupportsDynamicToolOwner to a VSPackage registration, see Using a Custom Registration Attribute to Register an Extension.