Dela via


CMFCShellTreeCtrl Class

The CMFCShellTreeCtrl class extends CTreeCtrl Class functionality by displaying a hierarchy of Shell items.

class CMFCShellTreeCtrl : public CTreeCtrl

Members

Public Methods

Name

Description

CMFCShellTreeCtrl::EnableShellContextMenu

Enables or disables the shortcut menu.

CMFCShellTreeCtrl::GetFlags

Returns a combination of flags that are passed to IShellFolder::EnumObjects.

CMFCShellTreeCtrl::GetItemPath

Retrieves the path to an item.

CMFCShellTreeCtrl::GetRelatedList

Returns a pointer to the CMFCShellListCtrl Class object that is used together with this CMFCShellTreeCtrl object to create an Explorer-like window.

CMFCShellTreeCtrl::OnChildNotify

This member function is called by this window's parent window when it receives a notification message that applies to this window. (Overrides CWnd::OnChildNotify.)

CMFCShellTreeCtrl::OnGetItemIcon

 

CMFCShellTreeCtrl::OnGetItemText

 

CMFCShellTreeCtrl::Refresh

Refreshes and repaints the current CMFCShellTreeCtrl object.

CMFCShellTreeCtrl::SelectPath

Selects the appropriate tree control item based on a supplied PIDL or string path.

CMFCShellTreeCtrl::SetFlags

Sets flags to filter the tree context (similar to the flags used by IShellFolder::EnumObjects).

CMFCShellTreeCtrl::SetRelatedList

Sets a relation between the current CMFCShellTreeCtrl object and a CMFCShellListCtrl object.

Remarks

This class extends the CTreeCtrl class by enabling your program to include Windows Shell items in the tree. This class can be associated with a CMFCShellListCtrl object to create a complete Explorer window. Then, selecting an item in the tree will display a list of Windows Shell items in the associated list.

Inheritance Hierarchy

CObject

   CCmdTarget

      CWnd

         CTreeCtrl

            CMFCShellTreeCtrl

Requirements

Header: afxshelltreeCtrl.h

Example

The following example demonstrates how to create an object of the CMFCShellTreeCtrl class. This code snippet is part of the Explorer sample.

    CMFCShellTreeCtrl   m_wndShellTree;


...


    // const int idTree = 1
    CRect rectDummy (0, 0, 0, 0);
    const DWORD dwViewStyle =   WS_CHILD | WS_VISIBLE | TVS_HASLINES | 
                                TVS_LINESATROOT | TVS_HASBUTTONS;

    // The this pointer points to CFolderBar class which extends the CDockablePane class
    m_wndShellTree.Create (dwViewStyle, rectDummy, this, idTree);

See Also

Reference

Hierarchy Chart

CTreeCtrl Class

CMFCShellListCtrl Class

Other Resources

MFC Classes