How-To Use Standard Verbs

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

Standard verbs can be set for scope nodes and the selection data objects by setting the respective ScopeNode.EnabledStandardVerbs and SelectionData.EnabledStandardVerbs properties for the desired standard verbs. Standard verbs handle the common actions such as showing Properties and Refresh. Setting a standard verb automatically adds the verb to the context menus and to the actions pane. Each standard verb has a specific handler that executes when it is clicked in the context menu or actions pane.

For standard verbs that work on selections you should update the selection data object whenever the selection changes, so that when the standard verb is triggered, the SelectionObject can be used to get the selection. The Update method is used to get unique identifiers of the selected items and works for all views, not just the MmcListView.

There is a standard verb for most typical actions that work with items in a tree or list. Scope nodes and selection data objects enable setting standard verbs. Note that snap-ins that support cut/copy/paste operations automatically support drag-and-drop operations on scope nodes and result nodes. In the case of a form view, drag-and-drop functionality must be explicitly coded. The standard verbs each have their own virtual method that can be overridden to provide special handling. This is summarized in the following table.

Standard Verb

Handling Method

Properties

OnAddPropertyPages

Called after a property sheet is created, to allow for the creation of the property pages for the node.

Copy

OnCut

Virtual method that is called to cut the current node after it has been successfully pasted elsewhere.

Delete

OnDelete

Virtual method that is called when the Delete standard verb is triggered on this node.

Paste

OnPaste

Virtual method that is called when data is pasted onto this node.

Print

OnPrint

Virtual method that is called when the Print standard verb is triggered.

Refresh

OnRefresh

Virtual method that is called when the Refresh standard verb is triggered.

Rename

OnRename

Virtual method that is called when the Rename standard verb is triggered.

To enhance performance and clarity, the use of standard verbs is recommended over the creation of custom actions with the same names. When a desired action is not in the list of StandardVerbs, then a custom action can be created. Custom actions appear in the context menu and in the actions pane. For a detailed example of a snap-in that uses standard verbs, see the sample <MMC 3.0 Samples>\StandardVerbsSample.

See Also

StandardVerbs
What's New in MMC 3.0