共用方式為


MMCN_SELECT message

The MMCN_SELECT notification message is sent to the snap-in's IComponent::Notify or IExtendControlbar::ControlbarNotify method when an item is selected in either the scope pane or result pane.

Parameters

lpDataObject [in]

For IComponent::Notify, this parameter is a pointer to the data object of the currently selected/deselected scope pane or result item. For IExtendControlbar::ControlbarNotify, this parameter is not used.

arg

BOOL bScope = (BOOL) LOWORD(arg);

BOOL bSelect = (BOOL) HIWORD(arg);

For IComponent::Notify, bScope is TRUE if the selected item is a scope item, or FALSE if the selected item is a result item. For bScope = TRUE, MMC does not provide information about whether the scope item is selected in the scope pane or in the result pane.

For IExtendControlbar::ControlbarNotify, bScope is TRUE if an item in the scope pane is selected, or FALSE if an item in the result pane is selected.

For either IComponent::Notify or IExtendControlbar::ControlbarNotify, bSelect is TRUE if the item is selected, or FALSE if the item is deselected.

param

LPDATAOBJECT pDataobject = (LPDATAOBJECT)param;

For IComponent::Notify, this parameter is not used. For IExtendControlbar::ControlbarNotify, pDataobject is the data object of the item being selected or deselected.

Return value

S_OK

The snap-in successfully handled the notification.

S_FALSE

The snap-in does not handle the notification. MMC then performs a default operation for the notification.

Remarks

When an IComponent::Notify method receives the MMCN_SELECT notification it should update the standard verbs.

When an IExtendControlbar::ControlbarNotify method receives the MMCN_SELECT notification it should update the custom toolbars. On select, it should detach unused toolbars and attach new ones as required. On deselect, to minimize flashing, it should not detach toolbars; it is best to disable them, but doing nothing on deselect is also acceptable.

Snap-ins should have the ability to create and attach toolbars when they receive a selection notification, regardless of whether the item is in the scope pane or result pane.

For snap-ins that have a custom result pane (OCX or web), MMC sends the MMCN_SELECT or MMCN_DESELECT_ALL notification with a special data object (DOBJ_CUSTOMOCX or DOBJ_CUSTOMWEB) when the result pane is selected or deselected. The notification is sent to the snap-in's IExtendControlbar::ControlbarNotify and IComponent::Notify method. The only way for snap-ins to identify the corresponding scope item is to use the cookie (of the scope item) cached during MMCN_SHOW.

Requirements

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

See also

IComponent::Notify

IExtendControlbar::ControlbarNotify