Condividi tramite


Funzione PSStringFromPropertyKey (propsys.h)

Crea una stringa che identifica una proprietà dalla chiave di tale proprietà.

Sintassi

PSSTDAPI PSStringFromPropertyKey(
  [in]  REFPROPERTYKEY pkey,
  [out] LPWSTR         psz,
  [in]  UINT           cch
);

Parametri

[in] pkey

Tipo: REFPROPERTYKEY

Riferimento a una struttura PROPERTYKEY che identifica una proprietà.

[out] psz

Tipo: LPWSTR

Puntatore a un buffer che riceve la stringa di output. Il buffer deve essere sufficientemente grande da contenere PKEYSTR_MAX WCHARs.

[in] cch

Tipo: UINT

Lunghezza del buffer a cui punta psz, in WCHARs.

Valore restituito

Tipo: HRESULT

Se questa funzione ha esito positivo, restituisce S_OK. In caso contrario, restituisce un codice di errore HRESULT .

Commenti

Il formato stringa recuperato è "{propkey.fmtid} propkey.pid". Ad esempio, la stringa di output per PKEY_Title è "{F29F85E0-4FF9-1068-AB91-08002B27B3D9} 2".

Esempio

Nell'esempio seguente, da includere come parte di un programma più ampio, viene illustrato l'uso di PSPropertyKeyFromString.

WCHAR szKey[PKEYSTR_MAX]

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

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

Requisiti

Requisito Valore
Client minimo supportato Windows XP con SP2, Windows Vista [solo app desktop]
Server minimo supportato Windows Server 2003 con SP1 [solo app desktop]
Piattaforma di destinazione Windows
Intestazione propsys.h
Libreria Propsys.lib
DLL Propsys.dll (versione 6.0 o successiva)
Componente ridistribuibile Windows Desktop Search (WDS) 3.0

Vedi anche

PSGetNameFromPropertyKey

PSPropertyKeyFromString