Partager via


IVsToolWindowFactory.CreateToolWindow Method

Enables the environment to create multiple on-demand tool windows that are implemented by VSPackages.

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

Syntax

'Declaration
Function CreateToolWindow ( _
    ByRef rguidPersistenceSlot As Guid, _
    dwToolWindowId As UInteger _
) As Integer
int CreateToolWindow(
    ref Guid rguidPersistenceSlot,
    uint dwToolWindowId
)
int CreateToolWindow(
    [InAttribute] Guid% rguidPersistenceSlot, 
    [InAttribute] unsigned int dwToolWindowId
)
abstract CreateToolWindow : 
        rguidPersistenceSlot:Guid byref * 
        dwToolWindowId:uint32 -> int
function CreateToolWindow(
    rguidPersistenceSlot : Guid, 
    dwToolWindowId : uint
) : int

Parameters

  • rguidPersistenceSlot
    Type: Guid%

    [in] Unique identifier of the tool window.

  • dwToolWindowId
    Type: UInt32

    [in] Double word containing the tool window ID.

Return Value

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

Remarks

COM Signature

From vsshell.idl:

HRESULT IVsToolWindowFactory::CreateToolWindow(
   [in] REFGUID rguidPersistenceSlot,
   [in] DWORD dwToolWindowId
);

When a VSPackage supports multi-instance tool windows, each window uses the same rguidPersistenceSlot. The dwToolWindowId parameter is used to differentiate between the various instances of the tool window. To create the initial instance of the tool window, call CreateToolWindow from your CreateTool implementation with the dwToolWindowId parameter set to zero.

.NET Framework Security

See Also

Reference

IVsToolWindowFactory Interface

Microsoft.VisualStudio.Shell.Interop Namespace