TE Edit Control Win32 / Win64 Help
Product page

GetTerCursorPos

Retrieve the current cursor position.

BOOL GetTerCursorPos(hWnd, CurLine, CurCol

HWND hWnd;window handle to be accessed
long far *CurLine;Pointer to a long variable where the current line number or the current absolute cursor position is returned
int far *CurCol;Pointer to an integer variable where the current column number is returned.

Description: This function returns the current cursor position. The cursor position can be retrieved as the absolute position or in terms of the line number and column number.To get the absolute cursor position, set the CurCol variable to -1 before calling this function. The absolute position (base 0) is returned in the CurLine variable.

Example:int CurCol=-1;long CurLine;

GetTerCursorPos(hWnd,&CurLine,&CurCol);returns absolute position in the CurLine variable.

To get the line (base 0) and column (base 0) position of the cursor, set the CurCol variable to a value other than -1 before calling this function.

int CurCol=0;

long CurLine;

GetTerCursorPos(hWnd,&CurLine,&CurCol);The current line number is returned in the CurLine variable, the current column is returned in the CurCol variable.

Return Value: This function returns TRUE when successful.