views:

98

answers:

3

how can you get the current line number in a multi-line edit control?

+1  A: 

Look at the EM_LINEFROMCHAR window message.

Thorsten Dittmar
+1  A: 

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
A: 

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