P
CHARFORMAT cf;
CHARRANGE cr;
memset(&cf, 0, sizeof(CHARFORMAT));
memset(&cr, 0, sizeof(CHARRANGE));
int textlength = text.length();
int charcount = GetWindowTextLength(hTextField);
cr.cpMin = (long)charcount;
cr.cpMax = (long)charcount;
SendMessage(hTextField, EM_EXSETSEL, NULL, (LPARAM)&cr);
SendMessage(hTextField, EM_REPLACESEL,(WPARAM)false, (LPARAM)text.c_str());
um im RichEdit Text zuadden ohne die Formatierung der Texte davor zu vernichten..