TerGetCaretPos
Get the current text insertion position.
long TerGetCaretPos(hWnd)
HWND hWnd; | The handle of the window to be accessed |
Description: This function returns the current text insertion position or the caret position. Please note that the editor differentiates between the text insertion position and the current cursor position as returned by the GetTerCursorPos function. When the user scrolls the text, the caret position (where the next text input will be inserted) remains the same. However, the cursor position changes in such a way that the cursor position is always maintained within the current visible text on the screen.
Return Value: This function returns the caret position. This value is returned as the character position since the beginning of the file. You can use the TerRowColToAbs function to convert this position in to line/column position. This function returns -1 if an error occurs.