I have a subclassed editbox which is all well and good.. I would like to be able to get the current line of wherever my cursor is.. other examples get the line index number from your selected text which is no good.
other examples expect you to know the line index number to do an EM_GETLINE. It works great with EM_GETLINE but how do I get the current line# (NDY)? via

invoke SendMessage, hwndEdit, EM_GETLINE, NDY, addr SingleLine

If I have to keep track of it myself, I would rather build my own control dernit..

Posted on 2003-12-17 13:44:48 by drarem
i didn't try it, but could work

call SendMessage, hEditBox, EM_LINEFROMCHAR, -1, 0
add eax, 1

in eax should be the current line.

Posted on 2003-12-17 14:41:20 by Bit7
Thanks, it works perfectly when subtracting 1 from eax instead of adding..

sub eax, 1..

and not adding or subtracting to/from eax when not throwing up a messagebox, I guess it depends on how you use it, but thanks again :)
Posted on 2003-12-18 07:09:19 by drarem
oops, just a transcription error :)

Posted on 2003-12-18 14:01:34 by Bit7