SHAddDefaultPropertiesByExt function (shobjidl.h)
Adds default properties to the property store as registered for the specified file extension.
Syntax
SHSTDAPI SHAddDefaultPropertiesByExt(
[in] PCWSTR pszExt,
[in] IPropertyStore *pPropStore
);
Parameters
[in] pszExt
Type: PCWSTR
A pointer to a null-terminated, Unicode string that specifies the extension.
[in] pPropStore
Type: IPropertyStore*
A pointer to the IPropertyStore interface that defines the default properties to add.
Return value
Type: HRESULT
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The list of properties used to set a default value comes from the SetDefaultsFor
registry value of the ProgID for the file association of the specified file extension. The list is prefixed by "prop:
" and contains the canonical names of the properties to set the default value, such as: "prop:System.Author;System.Document.DateCreated
". The possible properties for this list are System.Author, System.Document.DateCreated, and System.Photo.DateTaken. If the SetDefaultsFor
value does not exist on the ProgID, this function uses the default found on the SetDefaultsFor
value of HKEY_CLASSES_ROOT*.
System.Author has the value of the user that performed the action. System.Document.DateCreated and System.Photo.DateTaken use the current date. These three properties are the only ones for which the system provides special defaults.
Note that there are several types of properties:
- Properties that derive from the file system (such as, size and date created)
- Properties that derive from the file (such as, dimensions and number of pages)
- Properties that are placed in the file (such as, author and tags)
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows Vista [desktop apps only] |
Minimum supported server | Windows Server 2008 [desktop apps only] |
Target Platform | Windows |
Header | shobjidl.h |
DLL | Shell32.dll |