IAccessible::accHitTest

[This is preliminary documentation and subject to change.]

Retrieves the child object at a given point on the screen.

HRESULT accHitTest(
  long xLeft, 
  long yTop,
  VARIANT *pvarChild
);
 

Parameters

xLeft and yTop
[in] Screen coordinates of the point to be hit tested.
pvarChild
[out, retval] Address of a VARIANT structure that will contain information describing the child object at the point specified by the xLeft and yTop parameters, if any. If the specified point exists outside the current object's boundaries, the VARIANT structure's vt member is VT_EMPTY. If the point exists within the current object but not within a child object, the vt member is VT_I4 and the lVal member is CHILDID_SELF. Otherwise, the vt member is VT_DISPATCH and the child object's IDispatch interface pointer is set in the pdispVal member.

Return Values

Returns S_OK if successful or a standard COM error code otherwise.

Remarks

When this method is used in certain situations, additional usage notes apply. For more information, see Object Navigation.

Note Implementers: This method must not fail for visual objects. Instead, set the vt member of the VARIANT structure to VT_EMPTY. Currently, the only nonvisual objects are sound objects.

See Also

VARIANT Structure, IDispatch Interface