SHSetTemporaryPropertyForItem function

Sets a temporary property for the specified item. A temporary property is kept in a read/write store that holds properties only for the lifetime of the IShellItem object, instead of writing them back into the item.

Syntax

SHSTDAPI SHSetTemporaryPropertyForItem(
  IShellItem     *psi,
  REFPROPERTYKEY propkey,
  REFPROPVARIANT propvar
);

Parameters

psi

Type: IShellItem*

A pointer to the item on which the temporary property is to be set.

propkey

Type: REFPROPERTYKEY

Reference to the PROPERTYKEY that identifies the temporary property that is being set.

propvar

Type: REFPROPVARIANT

Reference to a PROPVARIANT that contains the value of the temporary property.

Return Value

Type: HRESULT

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

Remarks

A temporary value can only be read with SHGetTemporaryPropertyForItem or by passing GPS_TEMPORARY to IShellItem2::GetPropertyStore.

Requirements

   
Windows version Windows Vista [desktop apps only] Windows Server 2008 [desktop apps only]
Target Platform Windows
Header shobjidl_core.h (include Shobjidl.h)
Library Shell32.lib
DLL Shell32.dll