This method wraps SetPropValue, SetPropServer, and ClearProps, and provides a convenient entry point for callers who are annotating Hwnd-based objects.

HRESULT ClearHwndProps (
  HWND hwnd,
  DWORD idObject,
  DWORD idChild,
  const MSAAPROPID* paProps
  int cProps


hwnd, idObject, idChild
[in] Identifies the accessible element that is to be annotated. This replaces the identity string.
paProps, cProps
[in] Specifies an array of properties that is to be reset. These properties will revert to the default behavior that they displayed before they were annotated.

For descriptions of other parameters, see the corresponding SetPropValue, SetPropServer, or ClearProps method.

Return Values

If successful, returns S_OK, even if the specified properties were never annotated on the accessible object; clearing already-cleared properties is considered a success.

Returns E_INVALIDARG if any of the properties in the paProps array are not supported.

May return other error codes under exceptional error conditions such as low memory.

For descriptions of return values, see the corresponding SetPropValue, SetPropServer, or ClearProps method.


By using this method, the caller does not have to obtain an identity string; it can specify the hwnd, idObject, and idChild parameters directly.

Additionally, SetHwndPropStr takes a regular Unicode string as a parameter; the caller does not need to specially allocate a BSTR.


  Windows NT/2000/XP/Server 2003: Included in Windows XP and Windows Server 2003.
  Windows 95/98/Me: Unsupported.
  Redistributable: Requires Active Accessibility 2.0 RDK on Windows NT 4.0 SP6 and Windows 98.
  Header: Declared in Oleacc.h; include Initguid.h before including Oleacc.h.

See Also

ClearProps, SetHwndProp, SetHwndPropServer, SetHwndPropStr