Instances of the folder type of assocation element are created by passing the corresponding CLSID to the AssocCreateElement function:

CLSID_AssocFolderElement {7566DF7A-42CC-475D-A025-1205DDF4911F}

As with all assocation elements, the folder element implements the IAssociationElement, IObjectWithQuerySource and IPersistString2 interfaces. However, all the methods of a folder element are the same as for the basic shell element except for SetString, QueryString and GetClassID. In effect, a folder element is just a shell element with a different query source and a different handling of one particular query.

Initialisation String

When a folder element is initialised through its SetString method, the registry key that is used as the query source is necessarily:


The FriendlyTypeName Query

Folder elements have their own handling of ASSOCQUERY 0x00170000 when put to the QueryString method. For the basic shell element, this query is answered from the FriendlyTypeName value in the element’s query source. For a folder element, the friendly type name is instead fetched from the SHELL32 string resources. Specifically, it is the whole of string resource 4131. In the English-language SHELL32, this resolves to “Folder”.


In ordinary usage, a folder element exists within a QueryAssociations object, also called an association array. There seem to be many ways to get a folder element created in an association array. One way is to call the AssocCreateForClasses function and specify ASSOCCLASS_FOLDER as the type for one or more association elements.