CURRENT WORK ITEM - PREVIEW ONLY

AssocShellVerbElement

Unlike other association elements, the shell verb element is not creatable through the AssocCreateElement function. Shell verb elements exist only as supporting objects for shell elements. The ordinary way in which they are created is that a method of the shell element’s IAssociationElement interface is called for a shell verb query. This is any query whose numerical value, from the ASSOCQUERY enumeration, has the 0x02000000 bit set. For such queries, the method’s pszExtra argument is interpreted as naming a shell verb. To handle the query, the shell element creates a shell verb element, which is also called the verb delegate, and passes it the query.

Note that such verb delegates are ordinarily created and destroyed for each query. There seem to be two points to having the verb delegate as a separate object. First, if many shell verb queries for the same verb are to be put to the same shell element, it would be more efficient to get a verb delegate for that combination of shell element and verb, and to put the queries to it directly. Second, with the verb delegate as a separate object, already selected for a particular verb, its queries can take a fresh pszExtra argument. A query of a verb delegate can thus be more elaborate than the same query put to the shell element. To create a persisting verb delegate, put query 0x0220000E to the shell element’s QueryObject method.

All shell verb elements implement the IAssociationElement and IObjectWithQuerySource interfaces. The query source is necessarily the following registry key:

Key: base\shell\verb

in which base is whatever registry key is used as the shell element’s query source and verb is the particular verb for which the shell verb element is created. The verb is either specified as the pszExtra argument to an IAssociationElement method or is defaulted.