SHPropertyBag_WriteBOOL

This function asks a property bag to write a boolean as the value of a named property.

Declaration

HRESULT
SHPropertyBag_WriteBOOL (
    IPropertyBag *ppb,
    LPCWSTR pszPropName,
    BOOL bValue);

Parameters

The ppb argument provides the address of an IPropertyBag interface.

The pszPropName argument provides the address of a null-terminated Unicode string that names the property.

The bValue argument provides the new value as a boolean.

Return Value

The function returns zero for success, else an error code.

Behaviour

If either of the ppb and pszPropName arguments are NULL, the function fails, with E_INVALIDARG as the error code. If the property bag’s Write method cannot write the boolean as a VT_BOOL type, the function fails. All non-zero values of bValue become VARIANT_TRUE (0xFFFF) for the VT_BOOL type.

Availability

The SHPropertyBag_WriteBOOL function is exported from SHLWAPI as ordinal 499 in version 6.00.

Though this function dates from 2001, it was still not documented by Microsoft in the MSDN Library at least as late as the CD edition dated January 2004.