The ObjectTypes property of the ShellTreeView determines what shell elements are displayed by the control. The ObjectType is a set type property defined as:
TShellObjectType = (otFolders, otNonFolders, otHidden);By default, only otFolders is included in ObjectTypes - meaning that a ShellTreeView will only display folders.
TShellObjectTypes = set of TShellObjectType;
Including the otNonFolders value would result in files to be included in the display (more correctly: non-folders). otHidden includes hidden items.
When you include otNonFolders (and otHidden) it will take some time for the component to display its content.
Active property?I have an application using TShellTreeView with otFolders and otNonFolders set for ObjectTypes. The actual shell tree is, by design, not visible, and is only presented to the user when actually needed.
When the form hosting the shelltreeview is created, the TShellTreeView will read the shell structure and populate the tree. Note that the component is not visible by default - therefore not "needed" at form creation. The process of enumerating the shell as done by the component takes some time (a few seconds) and it appears as if the application is frozen.
Unfortunately, there's no Active property one can set to false to force the component NOT to display its contents.
Fortunately, there's the ObjectTypes property you can set to an empty set:
ShellTreeView1.ObjectTypes := ; //display nothingBy setting the ObjectTypes property to an empty set value you can fake a non - existing Active property.
As previously said, when the form is created the shelltreeview, in my application, is not visible - therefore I do not need it to display any content (folders / files / network locations, ...).
When a user wants to use the shell tree view I will simply set the ObjectTypes property to a "non-empty" value - thus having the control display shell elements:
if (shellTreeView.ObjectTypes = ) thenYes, it does take some time for the control to refresh (display shell elements) but this time the user is aware of what is happening.
//activate the control
shellTreeView.ObjectTypes := [otFolders, otNonFolders];