Retrieves a zero-length text range at the location of the caret that belongs to the text-based control.
HRESULT GetCaretRange( [out, retval] BOOL *isActive, [out, retval] IUIAutomationTextRange **ppRange );
- isActive [out, retval]
TRUE if the text-based control that contains the caret has keyboard focus, otherwise FALSE.
- ppRange [out, retval]
Receives a text range that represents the current location of the caret that belongs to the text-based control.
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
If the isActive parameter is FALSE, the caret that belongs to the text-based control might not be at the same location as the system caret.
This method retrieves a text range that a client can use to find the bounding rectangle of the caret belonging to the text-based control, or to find the text near the caret.
Minimum supported client
|Windows 8 [desktop apps only]|
Minimum supported server
|Windows Server 2012 [desktop apps only]|
- UI Automation Support for Textual Content
- Working with Text-based Controls