The Wayback Machine - https://web.archive.org/web/20080417193207/http://msdn2.microsoft.com:80/en-us/library/bb776147.aspx
Click to Rate and Give Feedback
Shell Interfaces
IColumnProvider Interface

Exposes methods that enable the addition of custom columns in the Microsoft Windows Explorer Details view.

Note  Support for IColumnProvider has been removed from Windows Vista. The new property system should be used in its place. See Property System for conceptual materials that explain the use of the new system.

IColumnProvider Members

GetColumnInfo Requests information about a column.
GetItemData Requests column data for a specified file.
Initialize Initializes an IColumnProvider interface.

Remarks

The Windows Explorer Details view typically displays several standard columns. Each column lists information, such as the file size or type, for each file in the current folder. There can also be a number of columns that the user can choose to display. When the user right-clicks one of the column headers, a list of the available columns is displayed in a dialog box. By creating a column provider object that exports the IColumnProvider interface, you can add custom columns to that dialog box for display by Windows Explorer. For example, a collection of files that contain music could use a column provider to display columns listing the artist and piece contained by each file.

A column provider is a global object that is called every time Windows Explorer displays the Details view. Windows Explorer queries all registered column providers for their column characteristics. If the user has selected one of the column provider's columns, Windows Explorer queries the column provider for the associated data for each file in the folder. It then displays all the selected columns.

Typically, column providers are used to display one or more custom columns for a particular file class. When a column provider receives a request for data, it provides it if the file is a member of its supported class. Otherwise, it ignores the request by returning S_FALSE.

Columns are identified by an SHCOLUMNID structure that contains an fmtid/pid pair. If possible, use existing fmtids and pids. If a folder contains files from more than one file class, the data from different classes can be merged into the same column. For instance, the Author pid from the summary information property set can be used for a wide variety of purposes. If you use a custom SHCOLUMNID structure, the column will display data only for those files that are members of the supported class. If the folder contains other files, their entries will be blank.

Implement an object that exports this interface when you want to have one or more custom columns displayed in the Windows Explorer Details view. Windows Explorer calls the interface methods to request the information it needs to display the column. The procedure used by Windows Explorer is as follows:

  1. Call IColumnProvider::Initialize to specify the folder to display.
  2. Call IColumnProvider::GetColumnInfo to retrieve the column's characteristics.
  3. If the column has been selected by the user, call IColumnProvider::GetItemData for each file in the folder to retrieve the data that belongs in the file's column entry.

In addition to normal Component Object Model (COM) registration, the column provider object must also be registered with Windows Explorer. To do so, add a subkey named with the string form of the object's GUID to this key.

  • HKEY_CLASSES_ROOT
    • Folder
      • shellex
        • ColumnHandlers

This interface is called by Windows Explorer. It is not typically used by applications.

Interface Information

Minimum DLL Versionshell32.dll version 5.0 or later
Custom ImplementationYes
Inherits fromIUnknown
Headershlobj.h
Minimum operating systems Windows 2000, Windows Me
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker