IAccessibleHandler::AccessibleObjectFromID
The AccessibleObjectFromID method retrieves an IAccessible interface pointer for the interface associated with the given object ID. Oleacc.dll uses this method to obtain an IAccessible interface pointer for proxies that are supplied by other code.
Note IAccessibleHandler::AccessibleObjectFromID is available for use in the Microsoft Windows 2000 and Windows XP operating systems. It may be altered or unavailable in subsequent versions.
For more information about COM parameter attributes, allocating memory, and freeing memory, see Definitions of Parameter Attributes.
HRESULT AccessibleObjectFromID(
long hwnd,long lObjectID,LPACCESSIBLE*pIAccessible,);
Parameters
- hwnd
[in] Specifies the handle of a window for which an IAccessible interface pointer is to be retrieved. - lObjectID
[in] Specifies the object ID. This value is one of the standard object identifier constants or a custom object ID. - pIAccessible
[out] Specifies the address of a pointer variable that receives the address of the object's IAccessible interface.
Return Values
If successful, returns S_OK.
If not successful, returns one of the following or another standard COM error code.
Error | Description |
---|---|
E_INVALIDARG | An argument is invalid. |
E_NOINTERFACE | The requested interface is not supported. |
Remarks
Oleacc calls this function to obtain an IAccessible interface pointer for HWNDs that have the class name that this handler is registered for.
At startup, Oleacc looks in the registry key HKLM\SOFTWARE\Microsoft\Active Accessibility\Handlers and enumerates over each subkey (Oleacc expects the subkey to be a GUID). Oleacc reads the associated class name from HKCR\CLSID\{guid}\AccClassName, where {guid} was the GUID found under the HKLM\SOFTWARE\Microsoft\Active Accessibility\Handlers key. When Oleacc finds a window with a class name that matches the GUID, it CoCreates the object using the GUID, retrieves the IAccessibleHandler interface pointer, and calls AccessibleObjectFromID on it to get at IAccessible interface pointer.
As with other IAccessible methods and functions, clients might receive errors for IAccessible interface pointers because of a user action. For more information, see Receiving Errors for IAccessible Interface Pointers.
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.