AccessibleObjectFromWindow

 

Description

 

The AccessibleObjectFromWindow function retrieves the address of the specified interface to the object associated with the given window.

 

C++ Syntax

 

STDAPI AccessibleObjectFromWindow(

HWND hwnd,

DWORD dwObjectID,

REFIID riid,

void** ppvObject

);

 

PowerBASIC Syntax

 

FUNCTION AccessibleObjectFromWindow ( _

BYVAL hwnd AS DWORD, _

BYVAL dwObjectID AS DWORD, _

BYREF riid AS GUID, _

BYREF ppvObject AS ANY _

) AS LONG

 

Parameters

 

hwnd

 

[in] 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] 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 Microsoft Office native object model. For more information about OBJID_NATIVEOM, see the Remarks section in this topic.

 

riid

 

[in] Specifies the reference identifier of the requested interface. This value is either IID_IAccessible or IID_IDispatch.

 

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 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

 

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.

 

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 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 application

Window class

IDispatch pointer to

Word

_WwG

Window

Excel

EXCEL7

Window

PowerPoint

paneClassDC

DocumentWindow

Command Bars

MsoCommandBar

CommandBar

 

Note that the above window classes correspond to the innermost document window or pane window.

 

Valid XHTML 1.0 Transitional