Condividi tramite


IVsUIShell.FindToolWindow Method

Returns the IVsWindowFrame pointer for the requested single-instance tool window.

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

Syntax

'Declaration
Function FindToolWindow ( _
    grfFTW As UInteger, _
    ByRef rguidPersistenceSlot As Guid, _
    <OutAttribute> ByRef ppWindowFrame As IVsWindowFrame _
) As Integer
int FindToolWindow(
    uint grfFTW,
    ref Guid rguidPersistenceSlot,
    out IVsWindowFrame ppWindowFrame
)
int FindToolWindow(
    [InAttribute] unsigned int grfFTW, 
    [InAttribute] Guid% rguidPersistenceSlot, 
    [OutAttribute] IVsWindowFrame^% ppWindowFrame
)
abstract FindToolWindow : 
        grfFTW:uint32 * 
        rguidPersistenceSlot:Guid byref * 
        ppWindowFrame:IVsWindowFrame byref -> int
function FindToolWindow(
    grfFTW : uint, 
    rguidPersistenceSlot : Guid, 
    ppWindowFrame : IVsWindowFrame
) : int

Parameters

  • grfFTW
    Type: UInt32

    [in] Provides criteria used to find a tool window in the environment. For more information, see __VSFINDTOOLWIN.

  • rguidPersistenceSlot
    Type: Guid%

    [in] Unique identifier for a tool window created using CreateToolWindow. The caller of this method can use predefined identifiers that map to tool windows if those tool windows are known to the caller.

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 IVsUIShell::FindToolWindow(
   [in] VSFINDTOOLWIN grfFTW,
   [in] REFGUID rguidPersistenceSlot,
   [out] IVsWindowFrame **ppWindowFrame
);

This method requires that a fully-created tool window exist. Because of the delayed creation of tool windows, a valid window frame may exist, but the window may not have been created yet. If the window frame is not filled with an object then the environment fails and the parent routine is responsible for finishing creating the window. However, if you specify a value of FTW_fForceCreate for the grfFTW parameter, then the environment attempts to create the tool window for you. If you specify a value of FTW_fFrameOnly, then the environment returns a pointer to window frame, even if the window frame is not populated with an object. Use the FTW_fFrameOnly value to set a property on the window frame for a tool window, in which case a fully created tool window is not required.

.NET Framework Security

See Also

Reference

IVsUIShell Interface

Microsoft.VisualStudio.Shell.Interop Namespace