A: The trick is to use the em_LineFromChar message. Try this:
{Note: First line is zero.}
ShowMessage('Line Number: ' + IntToStr(Memo1.Perform(EM_LineFromChar,
$FFFF, 0)));
to get row AND col you might do this:
Row := SendMessage(Memo1.Handle, EM_LineFromChar, Memo1.SelStart, 0);
Col := Memo1.SelStart - SendMessage(Memo1.Handle, EM_LineIndex, Row,
0);
Note: The answer that this gives indicates where the cursor is
in the memo field and not where the cursor is in the display of that memo
field. Remember also that the arrays are zero based. This means
that if the cursor is placed before the first character of the first line,
that the row and col values will be zero.