2

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

cpx
  • 17,009
  • 20
  • 87
  • 142

3 Answers3

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
2

Look at the EM_LINEFROMCHAR window message.

Thorsten Dittmar
  • 55,956
  • 8
  • 91
  • 139
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