Compartir a través de


Changing a Static Node's Attributes during Loading

As is true of all other scope items, a stand-alone snap-in can programmatically change the display attributes of a static node (for example, its icon and display name) at any time by calling the IConsoleNameSpace2::SetItem method.

When the user saves the current console, MMC stores the icon and display name of each static node in the console tree in the .msc file that it creates. When the user loads the .msc file, MMC uses the stored icon and display name of the static node when that displays it.

Now, there are situations in which a snap-in may want to change the display attributes of its static node before it appears in a console tree. For example, the snap-in might collect information from the user that is used to construct the static node's display name.

To change a static node's attributes when loading a snap-in, the snap-in must support the CCF_SNAPIN_PRELOADS clipboard format and also handle the MMCN_PRELOAD notification.

When saving a console file, MMC calls IDataObject::GetDataHere on each loaded snap-in using the CCF_SNAPIN_PRELOADS clipboard format. If the snap-in handles the clipboard format and returns TRUE, MMC calls the IComponentData::Notify method of the snap-in with the MMCN_PRELOAD notification the next time the snap-in is loaded from the saved console file. If the snap-in does not support CCF_SNAPIN_PRELOADS, MMC uses the static node's cached icon and display name instead.

Changing a Static Node's Attributes during Loading: Implementation Details

Working with the Scope Pane: Interfaces

Working with the Scope Pane: Implementation Details