INameSpaceTreeControl::InsertRoot method (shobjidl_core.h)

Inserts a Shell item on a root item in a tree.

Syntax

HRESULT InsertRoot(
  [in]           int              iIndex,
  [in]           IShellItem       *psiRoot,
  [in]           SHCONTF          grfEnumFlags,
  [in]           NSTCROOTSTYLE    grfRootStyle,
  [in, optional] IShellItemFilter *pif
);

Parameters

[in] iIndex

Type: int

The index at which to insert the root.

[in] psiRoot

Type: IShellItem*

A pointer to the Shell item that is being inserted.

[in] grfEnumFlags

Type: SHCONTF

Enumerates the qualities of the root and all of its children. One of the values of type SHCONTF.

[in] grfRootStyle

Type: NSTCROOTSTYLE

The style of the root that is being inserted. One or more of the following values (flags can be combined using a bitwise OR).

NSTCRS_VISIBLE (0x0000)

The root is visible as well as the items. Mutually exclusive with NSTCRS_HIDDEN.

NSTCRS_HIDDEN (0x0001)

The root is hidden so that only the children are visible. Mutually exclusive with NSTCRS_VISIBLE.

NSTCRS_EXPANDED (0x0002)

The root is expanded upon initialization.

[in, optional] pif

Type: IShellItemFilter*

A pointer to the IShellItemFilter that enables you to filter which items in the tree are displayed. If supplied, every item is customizable with a SHCONTF flag. This value can be NULL if no filter is required.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Requirement Value
Minimum supported client Windows Vista [desktop apps only]
Minimum supported server Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)