ITextRangeProvider::FindText method (uiautomationcore.h)

Returns a text range subset that contains the specified text.

Syntax

HRESULT FindText(
  [in]          BSTR               text,
  [in]          BOOL               backward,
  [in]          BOOL               ignoreCase,
  [out, retval] ITextRangeProvider **pRetVal
);

Parameters

[in] text

Type: BSTR

The text string to search for.

[in] backward

Type: BOOL

TRUE if the last occurring text range should be returned instead of the first; otherwise FALSE.

[in] ignoreCase

Type: BOOL

TRUE if case should be ignored; otherwise FALSE.

[out, retval] pRetVal

Type: ITextRangeProvider**

Receives a pointer to the text range matching the specified text; otherwise NULL. This parameter is passed uninitialized.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Remarks

There is no differentiation between hidden and visible text.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps | UWP apps]
Minimum supported server Windows Server 2003 [desktop apps | UWP apps]
Target Platform Windows
Header uiautomationcore.h (include UIAutomation.h)

See also

Conceptual

ITextProvider

ITextRangeProvider

Reference

UI Automation Providers Overview