IVsUIHierarchyWindow2.Init Method

Initializes a custom use of a UI hierarchy window.

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

Syntax

'Declaration
Function Init ( _
    pUIH As IVsUIHierarchy, _
    grfUIHWF As UInteger, _
    <OutAttribute> ByRef ppunkOut As Object _
) As Integer
int Init(
    IVsUIHierarchy pUIH,
    uint grfUIHWF,
    out Object ppunkOut
)
int Init(
    [InAttribute] IVsUIHierarchy^ pUIH, 
    [InAttribute] unsigned int grfUIHWF, 
    [OutAttribute] Object^% ppunkOut
)
abstract Init : 
        pUIH:IVsUIHierarchy * 
        grfUIHWF:uint32 * 
        ppunkOut:Object byref -> int
function Init(
    pUIH : IVsUIHierarchy, 
    grfUIHWF : uint, 
    ppunkOut : Object
) : int

Parameters

  • grfUIHWF
    Type: UInt32

    [in] Characteristics of the UI hierarchy window. For a list of values, see the __UIHWINFLAGS enumeration.

  • ppunkOut
    Type: Object%

    [out] Pointer to the IUnknown interface of the IVsWindowFrame2 object containing the UI hierarchy window.

Return Value

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

Remarks

The project window of the environment is a reusable UI element. VSPackages can use an instance of a UI hierarchy window to have a tool window that functions similar to the built-in Project Window. An example use of the UI hierarchy window is the Server Explorer.

A UI hierarchy window is created by passing CLSID_VSUIHIERARCHYWINDOW in a call to the method CreateToolWindow. The IVsUIHierarchyWindow interface can be accessed using the interface IUnknown::QueryInterface of the VSFPROPID_DocView object of the tool window returned by this call.

If you must get to any service accessible to the UI hierarchy window (for example, the SID_SVsTrackSelectionEx service or the SID_SUndoManager service), then you can retrieve the VSFPROPID_SPFrame property from the UI hierarchy window's window frame. This returns the IServiceProvider interface of the window frame.

UI hierarchy windows that have multiple top-level nodes require a way to handle selections that include multiple hierarchies. This is because the common parent hierarchy handles commands, if the selection is across hierarchies. To handle such selections, do one of the following:

.NET Framework Security

See Also

Reference

IVsUIHierarchyWindow2 Interface

Microsoft.VisualStudio.Shell.Interop Namespace