SHSetDefaultProperties function (shobjidl.h)
Applies the default set of properties on a Shell item.
Syntax
SHSTDAPI SHSetDefaultProperties(
[in, optional] HWND hwnd,
[in] IShellItem *psi,
DWORD dwFileOpFlags,
[in, optional] IFileOperationProgressSink *pfops
);
Parameters
[in, optional] hwnd
Type: HWND
A handle to the item's parent window, which receives error notifications. This value can be NULL.
[in] psi
Type: IShellItem*
A pointer to the IShellItem object that represents the item.
dwFileOpFlags
Type: DWORD
Flags that customize the operation. See IFileOperation::SetOperationFlags for flag values.
[in, optional] pfops
Type: IFileOperationProgressSink*
A pointer to an IFileOperationProgressSink object used to follow the progress of the operation. See IFileOperation::Advise for details. This value can be NULL.
Return value
Type: HRESULT
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
The list of properties to set a default value comes from the SetDefaultsFor registry entry under the ProgID for the file association of the item. The list is prefixed by "prop:
" and contains the canonical names of the properties to set the default value, for example, "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 entry does not exist on the ProgID, this function uses the default found on the SetDefaultsFor entry of HKEY_CLASSES_ROOT\*.
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 |
Library | Shell32.lib |
DLL | Shell32.dll |