Hallo again,

I have another question about richedits.
How can I delete the line, where the cursor is in?

Greetings, Nordwind
Posted on 2002-03-27 13:32:36 by Nordwind64
I'm not sure but the only solution I can think of is:

1.)
EM_SETSEL to select the text
EM_REPLACESEL to replace/delete the text selected with a parameter for the string as NULL

2.)
EM_SETSEL to select the text
then send a WM_CLEAR to the clear the selcted text

Or try checking out these other messages: EM_LINEINDEX or EM_LINELENGTH
Posted on 2002-03-27 14:41:02 by stryker
Thank you,
but how can I detect the first and last character in a line if the cursor is in the middle of the line?
Posted on 2002-03-27 14:45:31 by Nordwind64
I haven't tried this but try looking at EM_SCROLLCARET or try combining the messages EM_SETSEL, EM_LINEINDEX, EM_LINELENGTH... if you want it to do the hard way

copy the text inside the edit control to a buffer then do something like this

For example if you want to get the first char and the last char on the 2nd line of the edit control. You can check for a newline on the first line, the next 2 character should be the first character on the second line, since the next byte after the newline is the carriage return then scan forward until you hit another newline character. The character before that second newline should be the last character of the second line. :)
Posted on 2002-03-27 15:02:42 by stryker
Hello stryker,

I found it...

EM_LINEINDEX with -1
EM_LINELENGTH
EM_SETSEL
WM_CUT

Thank you !!!
Posted on 2002-03-27 16:02:02 by Nordwind64