Dela via


CMFCShellListCtrl Class

The CMFCShellListCtrl class provides Windows list control functionality and expands it by including the ability to display a list of shell items.

class CMFCShellListCtrl : public CMFCListCtrl

Members

Public Methods

Name

Description

CMFCShellListCtrl::DisplayFolder

Displays a list of items that are contained in a provided folder.

CMFCShellListCtrl::DisplayParentFolder

Displays a list of items that are contained in the folder that is the parent of the currently displayed folder.

CMFCShellListCtrl::EnableShellContextMenu

Enables or disables the shortcut menu.

CMFCShellListCtrl::GetCurrentFolder

Retrieves the path of the current folder.

CMFCShellListCtrl::GetCurrentFolderName

Retrieves the name of the current folder.

CMFCShellListCtrl::GetCurrentItemIdList

Returns the PIDL of the current list control item.

CMFCShellListCtrl::GetCurrentShellFolder

Returns a pointer to the current Shell folder.

CMFCShellListCtrl::GetItemPath

Returns the textual path of an item.

CMFCShellListCtrl::GetItemTypes

Returns Shell item types that are displayed by the list control.

CMFCShellListCtrl::IsDesktop

Checks if the currently selected folder is the desktop folder.

CMFCShellListCtrl::OnCompareItems

The framework calls this method when it compares two items. (Overrides CMFCListCtrl::OnCompareItems.)

CMFCShellListCtrl::OnFormatFileDate

Called when the framework retrieves the file date displayed by the list control.

CMFCShellListCtrl::OnFormatFileSize

Called when the framework converts the file size of a list control.

CMFCShellListCtrl::OnGetItemIcon

Called when the framework retrieves the icon of a list control item.

CMFCShellListCtrl::OnGetItemText

Called when the framework converts the text of a list control item.

CMFCShellListCtrl::OnSetColumns

Called by the framework when it sets the names of the columns.

CMFCShellListCtrl::Refresh

Refreshes and repaints the list control.

CMFCShellListCtrl::SetItemTypes

Sets the type of items displayed by the list control.

Remarks

The CMFCShellListCtrl class extends the functionality of the CMFCListCtrl Class by enabling your program to list Windows shell items. The display format that is used is like that of a list view for an Explorer window.

A CMFCShellTreeCtrl object can be associated with a CMFCShellListCtrl object to create a complete Explorer window. Then, selecting an item in the CMFCShellTreeCtrl will cause the CMFCShellListCtrl object to list the contents of the selected item.

Example

The following example demonstrates how to create an object of the CMFCShellListCtrl class and how to display the parent folder of the currently displayed folder. This code snippet is part of the Explorer sample.

    CMFCShellListCtrl   m_wndList;


...


    CRect rectDummy (0, 0, 0, 0);
    // The this pointer points to CExplorerView class which extends the CView class.
    m_wndList.Create (WS_CHILD | WS_VISIBLE | LVS_REPORT, rectDummy, this, 1);


...


    m_wndList.DisplayParentFolder ();

Inheritance Hierarchy

CObject

   CCmdTarget

      CWnd

         CListCtrl

            CMFCListCtrl

               CMFCShellListCtrl

Requirements

Header: afxshelllistCtrl.h

See Also

Reference

Hierarchy Chart

CMFCListCtrl Class

CMFCShellTreeCtrl Class

Other Resources

MFC Classes