Compartilhar via


Registering Tool Windows

VSPackages that provide tool windows must register with Visual Studio as tool window providers. Tool windows created by using the Visual Studio Package template do this by default. Tool window providers have system registry keys that specify visibility attributes, such as default tool window size and location, the GUID of the window that serves as the tool window pane, and docking style.

During development, managed tool window providers register tool windows by adding attributes to the source code, and then running the RegPkg.exe utility on the resulting assembly. For more information, see How to: Register a Tool Window.

Registering Unmanaged Tool Window Providers

Unmanaged tool window providers must register with Visual Studio in the ToolWindows section of the system registry. The following .reg file fragment shows how a dynamic tool window might be registered:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\<version number>\ToolWindows\{f0e1e9a1-9860-484d-ad5d-367d79aabf55}]
@="{01069cdd-95ce-4620-ac21-ddff6c57f012}"
"Name"="Microsoft.Samples.VisualStudio.IDE.ToolWindow.DynamicWindowPane"
"Float"="250, 250, 410, 430"
"DontForceCreate"=dword:00000001

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\8.0Exp\ToolWindows\{f0e1e9a1-9860-484d-ad5d-367d79aabf55}\Visibility]
"{f1536ef8-92ec-443c-9ed7-fdadf150da82}"=dword:00000000

In the first key in the example above, version number is the version of Visual Studio, such as 7.1 or 8.0, the subkey {f0e1e9a1-9860-484d-ad5d-367d79aabf55} is the GUID of the tool window pane (DynamicWindowPane), and the default value {01069cdd-95ce-4620-ac21-ddff6c57f012} is the GUID of the VSPackage providing the tool window. For an explanation of the Float and DontForceCreate subkeys, see Tool Window Display Configuration.

The second optional key, ToolWindows\Visibility, specifies the GUIDs of commands that require the tool window to be made visible. In this case, there are no commands specified. For more information, see Tool Window Display Configuration.

See Also

Concepts

VSPackage Essentials