Share via


IUIAutomationTextRange::CompareEndpoints Method

Retrieves a value that specifies whether the start or end point of this text range is the same as the start or end point of another one.

Syntax

HRESULT CompareEndpoints(      
    TextPatternRangeEndpoint srcEndPoint,
    IUIAutomationTextRange *range,
    TextPatternRangeEndpoint targetEndPoint,
    int *compValue
);

Parameters

  • srcEndPoint
    [in] A value from the TextPatternRangeEndpointEnum enumerated type specifying whether the start or end point of this text range is to be compared.
  • range
    [in] The address of the IUIAutomationTextRange interface of the text range to compare.
  • targetEndPoint
    [in] A value from the TextPatternRangeEndpointEnum enumerated type specifying whether the start or end point of range is to be compared.
  • compValue
    [out, retval] The address of a variable that receives a negative value if the caller's endpoint occurs earlier in the text than the target endpoint; 0 if the caller's endpoint is at the same location as the target endpoint; or a positive value if the caller's endpoint occurs later in the text than the target endpoint.

Return Value

Returns S_OK if successful, or an error value otherwise.