Export (0) Print
Expand All

PSStringFromPropertyKey function

Creates a string that identifies a property from that property's key.

Syntax


HRESULT PSStringFromPropertyKey(
  _In_   REFPROPERTYKEY pkey,
  _Out_  LPWSTR psz,
  _In_   UINT cch
);

Parameters

pkey [in]

Type: REFPROPERTYKEY

Reference to a PROPERTYKEY structure that identifies a property.

psz [out]

Type: LPWSTR

Pointer to a buffer that receives the output string. The buffer should be large enough to contain PKEYSTR_MAX WCHARs.

cch [in]

Type: UINT

The length of the buffer pointed to by psz, in WCHARs.

Return value

Type: HRESULT

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

Remarks

The string format retrieved is "{propkey.fmtid} propkey.pid". For example, the output string for PKEY_Title is "{F29F85E0-4FF9-1068-AB91-08002B27B3D9} 2".

Examples

The following example, to be included as part of a larger program, demonstrates the use of PSPropertyKeyFromString.


WCHAR szKey[PKEYSTR_MAX]

HRESULT hr = PSStringFromPropertyKey(PKEY_Title, szKey, ARRAYSIZE(szKey));

if (SUCCEEDED(hr))
{
    // szKey is now valid.
}

Requirements

Minimum supported client

Windows XP with SP2, Windows Vista [desktop apps only]

Minimum supported server

Windows Server 2003 with SP1 [desktop apps only]

Redistributable

Windows Desktop Search (WDS) 3.0

Header

Propsys.h

Library

Propsys.lib

DLL

Propsys.dll (version 6.0 or later)

See also

PSPropertyKeyFromString
PSGetNameFromPropertyKey

 

 

Community Additions

ADD
Show:
© 2014 Microsoft