Share via


MMC 2.0 Notification Messages

MMC notifications are generated by events caused by user input. MMC can send notification messages to the snap-in's IComponentData::Notify, IComponent::Notify, or IExtendControlbar::ControlbarNotify methods, depending on the notification.

Generally, notification messages generated because of user input in the scope pane are sent to the snap-in's IComponentData implementation. Notification messages generated from user actions in the result pane are sent to the IComponent instance that corresponds to the current view (MDI child window).

MMC calls the snap-in's IExtendControlbar::ControlbarNotify method when users initiate actions related to the toolbar.

For a list of all MMC notifications, see MMC Notifications in the MMC Reference .

Depending on the notification type, MMC might include a pointer to a data object from the snap-in for the currently selected item in the scope or result pane. MMC requests the data object from the snap-in when the user selects the item and then returns the data object to the snap-in to provide the context information the snap-in must handle the notification message generated by a user action. This context information includes the cookie value of the affected item, whether the item is a scope or result item, and whether the item is selected or deselected.

Be aware that snap-ins are encouraged to implement default notification handlers for all MMC notifications and to return a value of S_FALSE for any notifications that they do not explicitly handle. This instructs MMC to perform a default operation for the particular notification.

Furthermore, when using a snap-in code base built for one version of MMC in a newer version of MMC, snap-in developers should ensure that their snap-ins implement default notification handlers for any new notifications available in the newer version. Otherwise, snap-ins may behave unexpectedly in the newer version. An example of this is the behavior of the Modify Columns dialog box, which allows users to customize list view columns. If user customizations are made, MMC sends the snap-in the MMCN_COLUMNS_CHANGED notification, which is introduced in MMC 1.2. For the customizations to take effect, the snap-in must return S_FALSE (or S_OK) in its MMCN_COLUMNS_CHANGED notification handler. If the notification is not handled, MMC will discard the user customizations.