Click to See Complete Forum and Search --> : Appending Text in RichEdit


sss0379
February 12th, 2003, 06:10 AM
Hello Everybody,
I have a problem how do i Append a string in an RichEdit box in Win32 API.

Thanking You,
Sonali.....

HAVE A GUD DAY!!!!!

Caprice
February 12th, 2003, 07:32 AM
SendMessage(hWnd, EM_SETSEL, - 1, 0);
SendMessage(hWnd, EM_REPLACESEL, (WPARAM)bCanUndo, (LPARAM)text);

I don't remember what exactly must be -1, 0 or 0, -1 in the first SendMessage.

filthy_mcnasty
February 12th, 2003, 01:36 PM
CHARRANGE cr;
cr.cpMin = -1;
cr.cpMax = -1;

SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM)&cr);
SendMessage(hwnd, EM_REPLACESEL, 0, (LPARAM)stringtoadd);