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