IUIAutomationTextPattern::RangeFromPoint Method

Retrieves the degenerate (empty) text range nearest to the specified screen coordinates.

Syntax

HRESULT RangeFromPoint(      
    POINT pt,
    IUIAutomationTextRange **range
);

Parameters

  • pt
    [in] A POINT structure that contains the location in screen coordinates.
  • range
    [out, retval] The address of a variable that receives a pointer to an IUIAutomationTextRange interface for the text range.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

A text range that wraps a child object is returned if the screen coordinates are within the coordinates of an image, hyperlink, Microsoft Excel spreadsheet, or other embedded object.

Because hidden text is not ignored, this method retrieves a degenerate range from the visible text closest to the specified coordinates.