• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 216
  • Last Modified:

How to restrict TShellTreeview to only display file and folders

Hi all, does anybody know a way of using the  TShellTreeview in delphi to display only regular files and folders, excluding the recycle bin, control panel etc, but including network files (but not the actual computers etc).

If not is there a suitable commercial/freeware robust component available.

This is driving me nuts, I know there has to be asimple solution to this!

Thanks
0
dhowes_UK
Asked:
dhowes_UK
  • 2
1 Solution
 
Eddie ShipmanAll-around developerCommented:
You have to inherit from TShellTreeView and modify the Populate procedure to ignore the ones
you don't want to show.
0
 
Eddie ShipmanAll-around developerCommented:
You can also write an AddFolder event handler to ignore the ones you don't want:

procedure TForm1.ShellTreeView1AddFolder(Sender: TObject;
  AFolder: TShellFolder; var CanAdd: Boolean);
begin
  if (AFolder.DisplayName = 'Recycle Bin') or
     (AFolder.DisplayName = 'My Documents') then
    CanAdd := False;
end;

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now