ShellBrowser Delphi Components Documentation
ContentsIndexHome
PreviousUpNext
ShellControls.TJamShellTree.AddRoot

Adds a new root node to the tree.

Syntax
Pascal
function AddRoot(const pAbsoluteItemIdList: IItemIdList; pExpand: Boolean = True): TJamShellTreeNode;
Parameters 
Description 
const pAbsoluteItemIdList: IItemIdList 
IItemIdList: The ItemIdList of the folder that should be added. 
pExpand: Boolean = True 
Boolean: Pass True if the new root node should be initially expanded; pass False if it should be initially displayed collapsed. 

TJamShellTreeNode: The corresponding tree node of the newly added root node.

In contrast to the RootedAt property, this function does not evaluate the MultipleRoots property, it adds the new root node regardless of its value.

The following example shows how to add a well known folder as root:

JamShellTree.AddRoot(TJamItemIdList.Create(SF_CONTROL));

The following example shows how to add a file system folder as additional root.

JamShellTree.AddRoot(TJamItemIdList.Create('C:\'));