Freigeben über


MMCN_RESTORE_VIEW message

The MMCN_RESTORE_VIEW notification is introduced in MMC 1.1.

The MMCN_RESTORE_VIEW notification message is sent to the snap-in's IComponent::Notify method when the result pane for a scope item must be restored by the snap-in after the user has navigated the view history using the back or forward buttons.

The MMCN_RESTORE_VIEW notification message is also sent to the snap-in when MMC applies persisted column configuration data to a list view. For more information, see Using Column Persistence.

Parameters

lpDataObject [in]

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

arg [in]

A pointer to an MMC_RESTORE_VIEW structure that contains information about a result pane view that must be restored by the snap-in.

param [out]

A pointer to a BOOL that specifies whether the snap-in has handled the notification.

TRUE specifies that the snap-in has handled the notification appropriately.

FALSE specifies that the snap-in did not handle the notification and MMC will attempt to restore the View menu selection based on the information stored in the view history. If the snap-in does not set the param value, MMC defaults to FALSE.

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

MMC maintains a navigation history of the result pane. For each item in the history, MMC stores the view type and view options specified by IComponent::GetResultViewType when the result pane was originally displayed during the course of the current console session. MMC also stores other information such as the scope item and the currently selected item in the View menu.

When the back and forward buttons are used to navigate the result pane history of a scope item, MMC sends the snap-in that owns the item an MMCN_RESTORE_VIEW notification that has a pointer to an MMCN_RESTORE_VIEW structure as its arg parameter and a pointer to a BOOL as its param parameter.

The snap-in should respond to the notification by setting itself to the same state as when that item originally appeared in the result pane. This means performing any initialization or assignment performed in the original call to IComponent::GetResultViewType or the notification handler for the context menu item that represents the view selected in the View menu.

If the item to display is a custom OCX, webpage, or taskpad, the snap-in should handle that notification by setting the appropriate menu item in the View context menu and initializing the OCX or taskpad (if necessary). Then the snap-in should set its internal view type state (usually, a member variable stores the current view type in the class that implements IComponent) and set the param value to TRUE.

If the item to display is a virtual list in the result pane, the snap-in should initialize or set up the virtual list, set its internal view type state, and set the param value to TRUE.

If the item to display is a standard list in the result pane, the snap-in only must set its internal view type state and set the param value to TRUE.

MMC then reselects the appropriate item in the scope pane and displays the item with the appropriate view in the result pane.

Be aware that MMC does not persist any view information other than the options specified by the IComponent::GetResultViewType method. If the snap-in must persist any other view information, it must implement a mechanism for storing the information and save it to stream or storage when the Save method of its IPersistStream or IPersistStorage interface implementation is called. Furthermore, this view-related information should be saved by the IPersistStream or IPersistStorage interface queried from the IComponent associated with the view. Only information not related to any specific view should be saved by the IPersistStream or IPersistStorage interface queried from the snap-in's IComponentData implementation.

One notable exception to the fact that MMC persists only the options specified by the GetResultViewType options is that MMC also persists list view column configuration data. For more information, see Using Column Persistence.

Requirements

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

See also

IComponent::GetResultViewType

IComponent::Notify

MMC_RESTORE_VIEW