次の方法で共有


MMCN_COLUMNS_CHANGED message

The MMCN_COLUMNS_CHANGED notification is introduced in MMC 1.2.

The MMCN_COLUMNS_CHANGED notification is sent to the snap-in's IComponent::Notify method when the user hides columns or makes columns visible in the list view using the Modify Columns dialog box.

The notification tells the snap-in which columns in the list view are visible. The param parameter passed to the snap-in in the IComponent::Notify method is a pointer to the MMC_VISIBLE_COLUMNS structure that contains the visible columns data.

Parameters

lpDataObject [in]

A pointer to the data object of the currently selected scope item.

arg

Zero.

param [in]

A pointer to an MMC_VISIBLE_COLUMNS structure that contains the list of visible columns.

Return value

S_OK

The snap-in accepts user changes to the visible/hidden status of columns in the list view, and MMC will apply these changes by updating the column configuration data of the affected column set.

S_FALSE

The snap-in does not handle the notification. MMC then performs a default operation for the notification, which is to apply the changes by updating the column configuration data.

E_UNEXPECTED

The snap-in rejects the user changes, and MMC will not apply these changes. Be aware that the snap-in is responsible for informing the user why it is refusing the user changes, for example, by means of a message box.

Remarks

MMC only updates and persists new column configuration data after the snap-in returns S_OK in its MMCN_COLUMNS_CHANGED notification handler. Consequently, if the snap-in queries for persisted column configuration data while handling the notification (before returning S_OK), it will retrieve currently persisted data. This data will not reflect the user changes that resulted in the MMCN_COLUMNS_CHANGED notification message to the snap-in.

The MMCN_COLUMNS_CHANGED notification is particularly useful in situations in which there is a concern about the performance impact of populating data in columns that aren't being displayed. A snap-in can choose to update only visible columns and can use information from MMCN_COLUMNS_CHANGED to do so.

Be aware that the MMCN_COLUMNS_CHANGED notification is not generated for column width changes or sorted column and sort direction changes made by the user or by the snap-in (using the IColumnData::SetColumnConfigData and IColumnData::SetColumnSortData methods).

Also, the MMCN_COLUMNS_CHANGED notification is not generated for any changes made by the snap-in using the IHeaderCtrl2::SetColumnWidth, IHeaderCtrl2::InsertColumn, and IHeaderCtrl2::DeleteColumn methods.

Requirements

Minimum supported client
Windows Vista
Minimum supported server
Windows Server 2008
Header
Mmc.h

See also

IColumnData

Using Column Persistence

IHeaderCtrl2 and Column Persistence