Using List Views: Implementation Details
To implement a list view
Implement the IComponent::GetResultViewType method. The ppViewType parameter specifies the view type. For standard list views, the value of the parameter should be NULL, indicating that MMC should display the default view type (list view). Specify the view options with the pViewOptions parameter. Use the MMC_VIEW_OPTIONS_NONE option to specify no view options.
Alternately, if IComponent::GetResultViewType returns S_FALSE, MMC will automatically set the view type to list view and the view options to MMC_VIEW_OPTIONS_NONE.
Handle the MMCN_SHOW notification message, which MMC sends to the snap-in's IComponent implementation to indicate that the result pane has the focus. In response to the notification, the snap-in should:
- If necessary, obtain interface pointers to the IHeaderCtrl2 and IResultData interfaces by querying the IConsole2 interface for them. Make sure to use the IConsole2 interface associated with the snap-in's IComponent implementation, and not with its IComponentData implementation.
- Add columns to the result pane using the IHeaderCtrl2::InsertColumn method.
- Enumerate the result data items for the result pane using the IResultData::InsertItem method.
- If necessary, set the view mode and view style for the list view using IResultData::SetViewMode and IResultData::ModifyViewStyle, respectively. One of the view modes you can set is filtered view. For more information about this mode, see Adding Filtered Views.
Implement the IComponent::GetDisplayInfo method. After the snap-in returns from the MMCN_SHOW notification handler, MMC calls its IComponent::GetDisplayInfo implementation once for each item in the result pane to request the item's display information.
Handle the MMCN_SELECT notification message, which MMC sends after MMCN_SHOW to indicate which item in the scope pane is currently selected. In the notification handler, the snap-in has the opportunity to update the standard verbs for the scope item. See Enabling MMC Standard Verbs for details.
MMCN_SELECT is also sent when a result item is selected, at which time the snap-in can update the standard verbs for the selected item in the result pane.