CreateStdAccessibleObject

The CreateStdAccessibleObject function creates an accessible object with the methods and properties for the specified type of system-provided user interface element.

STDAPI CreateStdAccessibleObject(
HWNDhwnd,LONGidObject,REFIIDriidInterface,void** ppvObject);

Parameters

  • hwnd
    [in] Window handle of the system-provided user interface element (a control) for which an accessible object is created.
  • idObject
    [in] Object ID. This value is usually OBJID_CLIENT, but may be another object identifier.
  • riidInterface
    [in] Reference identifier of the requested interface. This value is one of the following: IID_IAccessible, IID_IDispatch, IID_IEnumVARIANT, or IID_IUnknown.
  • ppvObject
    [out] Address of a pointer variable that receives the address of the specified interface.

Return Values

If successful, returns S_OK.

If not successful, returns a standard COM error code.

Remarks

Server applications call this function when they contain a custom UI object that is similar to a system-provided object. Previously, server developers called CreateStdAccessibleObject to override the IAccessible methods and properties as required to match their custom objects. With Active Accessibility 2.0, server developers can use Dynamic Annotation to override specific properties without having to use difficult subclassing techniques that were required with CreateStdAccessibleObject. Server developers should still use CreateStdAccessibleObject for structural changes, such as hiding a child element or creating a placeholder child element. This approach saves server developers the work of fully implementing all of the IAccessible properties and methods.

This function is similar to CreateStdAccessibleProxy, except that CreateStdAccessibleProxy allows you to specify the class name as a parameter whereas CreateStdAccessibleObject uses the class name associated with the hwnd parameter.

Requirements

**  Windows NT/2000/XP/Server 2003:** Included in Windows 2000 and later.
**  Windows 95/98/Me:** Included in Windows 98 and later.
**  Redistributable:** Requires Active Accessibility 1.3 RDK on Windows NT 4.0 SP6 and Windows 95.
**  Header:** Declared in Oleacc.h.
**  Library:** Use Oleacc.lib.

See Also

IDispatch Interface, CreateStdAccessibleProxy, Shortcuts for Exposing Custom User Interface Elements