how can you get the current line number in a multi-line edit control?
Asked
Active
Viewed 1,450 times
2
-
1Doesn't really matter - he said "winapi" in his tags. While it would be easier to do in C#... :-) – Thorsten Dittmar Feb 16 '10 at 12:37
3 Answers
6
From the docs for EM_LINEFROMCHAR
, if you pass -1
as wParam
, you get the line number of the line containing the caret (or the start of the selection if there is one).

AakashM
- 62,551
- 17
- 151
- 186
1
Did you try checking the MSDN index for anything beginning with EM_*. If you did, you'd find EM_LINEFROMCHAR, EM_LINEINDEX, EM_LINELENGTH, etc, which can probably solve your problem

erikkallen
- 33,800
- 13
- 85
- 120