Как узнать координаты курсора в TRichEdit.
Компилятор: C++ Builder
TPoint Point;
GetCaretPos(&Point);
DWORD both = 0;
both = MAKELPARAM(Point.x, Point.y);
int indexLine = RichEdit1->Perform(EM_LINEFROMCHAR, -1, 0);
int indexLength = (LOWORD(both)/8) + RichEdit1->SelLength;
indexLength++;
indexLine++;
char RowCol[10] = " ";
sprintf(RowCol, "%d:%d", indexLine, indexLength);
StatusBar1->Panels->Items[4]->Text = RowCol;
|