How to restrict TShellTreeview to only display file and folders

Posted on 2006-04-10
Last Modified: 2010-04-04
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!

Question by:dhowes_UK
    LVL 26

    Expert Comment

    You have to inherit from TShellTreeView and modify the Populate procedure to ignore the ones
    you don't want to show.
    LVL 26

    Accepted Solution

    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);
      if (AFolder.DisplayName = 'Recycle Bin') or
         (AFolder.DisplayName = 'My Documents') then
        CanAdd := False;


    Featured Post

    What Should I Do With This Threat Intelligence?

    Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

    Join & Write a Comment

    Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
    Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now