TextGRAB SDK Documentation | ITextGRABSDK::CaptureFromSelection

Captures the text from target window within target rectangle.

HRESULT CaptureFromSelection(

INT_PTR hwndTarget,
tagRECT* rect,
BSTR* text


[Visual Basic]

ByVal hwndTarget As INT_PTR,
ByRef rect As tagRECT,
ByRef text As String


void ITextGRABSDK.CaptureFromSelection(

INT_PTR hwndTarget,
ref tagRECT rect,
ref string text



[in] target window handle.
[in] target rectangle screen coordinates.
[out] captured formatted text.

Return Value(s)


Return Value(s) Definitions
S_OK (0x00000000) Operation was completed successfully.
E_FAIL (0x80004005) Error.
E_INVALIDARG (0x80070057) The hwnd parameter is not a valid window handle.
E_POINTER (0x80004003) The text parameter is NULL.
S_FALSE (0x00000001) The text could not be captured. Empty string was returned.
FAILED(hr) Appropriate error message.

See Also

ITextGRABSDK interface | tagRECT