Search code examples
c++winapimfcwindows-controls

TreeListView control


I need to implement TreeList control same as in Process Explorer. I am quite newbie in GUI and did not write such complicated controls.

As I see in Process Explorer, there is a TreeListWindowClass, which contains children: 2 headers, 3 scrollbars (one of them is invisible?) and 1 static (place between visible scrollbars). As I understand, main control draws all items inside itself. Also I did not found mfcxxx.dll in attached dlls.

Question 1: what framework it’s better to use? There are: MFC, WTL, plain WinAPI … I took a look at this implementation http://www.codeguru.com/cpp/controls/treeview/classes/article.php/c13167 and was confused with > 8000 lines of code in cpp file with huge structures (one of them contains 80 members). It is plain WinAPI (and C without ++). I definitely want to use OOP style. =)

Question 2: What is the high-level design of this control should be? Can you explain without deep details how does this control should be designed?

My limitations: C++, VS10, OS: Vista and higher.

Thanks in advance


Solution

  • I did this recently and used the Multi-Column Tree View from http://www.mimec.org/articles/mfc/mctree

    Screenshot of Multi-Column Tree View

    It is fairly basic, but it met my needs and is fairly compact. It provides a CColumnTreeView class which is a sub-class of CView - so it works correctly with the standard CDocument/CView pattern of MFC.