EN
Este conteúdo não está disponível em seu idioma, mas aqui está a versão em inglês.

PSGetItemPropertyHandler function

Retrieves a property handler for a Shell item.

Syntax


PSSTDAPI PSGetItemPropertyHandler(
  _In_   IUnknown *punkItem,
  _In_   BOOL fReadWrite,
  _In_   REFIID riid,
  _Out_  void **ppv
);

Parameters

punkItem [in]

Type: IUnknown*

A pointer to the IUnknown interface of a Shell item that supports IShellItem.

Windows XP: Use SHCreateShellItem to create the Shell item.

Windows Vista: Use SHCreateItemFromIDList, SHCreateItemFromParsingName, SHCreateItemFromRelativeName, SHCreateItemInKnownFolder, or SHCreateItemWithParent to create the Shell item.

fReadWrite [in]

Type: BOOL

TRUE to retrieve a read/write property handler. FALSE to retrieve a read-only property handler.

riid [in]

Type: REFIID

Reference to the IID of the interface the handler object should return. This should be IPropertyStore or an interface derived from IPropertyStore.

ppv [out]

Type: void**

When this function returns, contains the interface pointer requested in riid.

Return value

Type: PSSTDAPI

Returns S_OK if successful, or an error value otherwise.

Remarks

This function is supported in Windows XP and Windows Vista. For applications supported only on Windows Vista or later, it is recommended that you use IShellItem2::GetPropertyStore instead of PSGetItemPropertyHandler. That method provides a richer set of properties in the property store that is returned.

This function is approximately equivalent to passing the GPS_HANDLERPROPERTIESONLY flag to IShellItem2::GetPropertyStore.

You must initialize Component Object Model (COM) with CoInitialize or OleInitialize before you call PSGetItemPropertyHandler. COM must remain initialized for the lifetime of this object.

Examples

The following example, to be included as part of a larger program, demonstrates how to use PSGetItemPropertyHandler to obtain a property handler for an item.


// IShellItem *psi;
// Assume variable psi is valid and initialized.
IPropertyStore *pStore;

HRESULT hr = PSGetItemPropertyHandler(psi, FALSE, IID_PPV_ARGS(&pStore));

if (SUCCEEDED(hr))
{
    // pStore is now valid and contains properties exposed through the 
    // property handler for the item.
 
    pStore->Release();
}

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)

 

 

Contribuições da comunidade

ADICIONAR
Mostrar:
© 2014 Microsoft