Knowledge Base

ShellBrowser Delphi Components



Question / Problem

How can I expand nodes like SF_FAVORITES or SF_LIBRARIES in the JamShellTree?

Answer / Solution

To expand these nodes, you may use code like this:

procedure TMainForm.FormShow(Sender: TObject);
var
    i:Integer;
begin
    i := 0;
    while (i < ShellTree.Items.Count) do
    begin
        if (ShellTree.Items[i].AbsoluteItemIdList.SpecialFolder in [SF_FAVORITES, SF_LIBRARIES]) then
            ShellTree.Items[i].Expand(False);
        Inc(i);
    end;
end;