Export (0) Print
Expand All

AccessibleObjectFromWindow function

Retrieves the address of the specified interface for the object associated with the specified window.

Syntax


STDAPI AccessibleObjectFromWindow(
  _In_   HWND hwnd,
  _In_   DWORD dwObjectID,
  _In_   REFIID riid,
  _Out_  void **ppvObject
);

Parameters

hwnd [in]

Type: HWND

Specifies the handle of a window for which an object is to be retrieved. To retrieve an interface pointer to the cursor or caret object, specify NULL and use the appropriate object ID in dwObjectID.

dwObjectID [in]

Type: DWORD

Specifies the object ID. This value is one of the standard object identifier constants or a custom object ID such as OBJID_NATIVEOM, which is the object ID for the Office native object model. For more information about OBJID_NATIVEOM, see the Remarks section in this topic.

riid [in]

Type: REFIID

Specifies the reference identifier of the requested interface. This value is either IID_IAccessible or IID_IDispatch, but it can also be IID_IUnknown, or the IID of any interface that the object is expected to support.

ppvObject [out]

Type: void**

Address of a pointer variable that receives the address of the specified interface.

Return value

Type: STDAPI

If successful, returns S_OK.

If not successful, returns one of the following or another standard COM error code.

Return codeDescription
E_INVALIDARG

An argument is not valid.

E_NOINTERFACE

The requested interface is not supported.

 

Remarks

Clients call this function to retrieve the address of an object's IAccessible, IDispatch, IEnumVARIANT, IUnknown, or other supported 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.

Clients use this function to obtain access to the Microsoft Office 2000 native object model. The native object model provides clients with accessibility information about an Office application's document or client area that is not exposed by Microsoft Active Accessibility.

To obtain an IDispatch interface pointer to a class supported by the native object model, specify OBJID_NATIVEOM in dwObjectID. When using this object identifier, the hwnd parameter must match the following window class types.

Office applicationWindow classIDispatch pointer to
Word_WwGWindow
ExcelEXCEL7Window
PowerPointpaneClassDCDocumentWindow
Command BarsMsoCommandBarCommandBar

 

Note that the above window classes correspond to the innermost document window or pane window. For more information about the Office object model, see the Microsoft Office 2000/Visual Basic Programmer's Guide.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Redistributable

Active Accessibility 1.3 RDK on Windows NT 4.0 with SP6 and later and Windows 95

Header

Oleacc.h

Library

Oleacc.lib

DLL

Oleacc.dll

See also

IAccessible
AccessibleObjectFromEvent
AccessibleObjectFromPoint
IDispatch

 

 

Community Additions

ADD
Show:
© 2014 Microsoft