CreateStdAccessibleProxy

The CreateStdAccessibleProxy function creates an accessible object that has the properties and methods of the specified class of system-provided user interface element.

STDAPI CreateStdAccessibleProxy(
HWNDhwnd,LPCTSTRpszClassName,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.
  • pszClassName
    [in] Pointer to a null-terminated string of the class name of a system-provided user interface element for which an accessible object is created. The window class name is one of the common controls (defined in Comctl32.dll), predefined controls (defined in User32.dll), or window elements.
  • idObject
    [in] Object ID. This value is OBJID_CLIENT, which is one of the object identifier constants.
  • riidInterface
    [in] Reference identifier of the interface requested. 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 control that is similar to a system-provided control. Previously, server applications called CreateStdAccessibleProxy to override the IAccessible methods and properties as required to match their custom controls. 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 CreateStdAccessibleProxy. Server developers should still use CreateStdAccessibleProxy 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 CreateStdAccessibleObject, except that CreateStdAccessibleObject always uses the class name associated with the hwnd whereas CreateStdAccessibleProxy allows you to specify the class name as a parameter.

Use CreateStdAccessibleProxy to create an accessible object for a user interface element that is superclassed. When a user interface element is superclassed, an application creates a custom control with a window class name different from the predefined control on which it is based. Because the class name associated with the hwnd parameter is the superclass window class name, specify the base class name (the system class name on which the superclassed control is based) in pszClassName.

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

Appendix A: Supported User Interface Elements Reference, CreateStdAccessibleObject, IDispatch Interface, Shortcuts for Exposing Custom User Interface Elements