SHGetNameFromPropertyKey function

Retrieves the property's canonical name given its PROPERTYKEY.

Syntax

HRESULT SHGetNameFromPropertyKey(
  _In_  REFPROPERTYKEY propkey,
  _Out_ PWSTR          *ppszCanonicalName
);

Parameters

  • propkey [in]
    Type: REFPROPERTYKEY

    A pointer to a PROPERTYKEY structure containing the property's identifiers.

  • ppszCanonicalName [out]
    Type: PWSTR*

    The address of a pointer to a buffer that receives the property name as a null-terminated Unicode string. It is the responsibility of the caller to release this string through a call to CoTaskMemFree once it is no longer needed.

Return value

Type: HRESULT

If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Requirements

Minimum supported client

Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2008 [desktop apps only]

Header

Shobjidl.h

DLL

Shell32.dll