Pelles C forum

C language => Expert questions => Topic started by: TimoVJL on June 14, 2010, 03:19:05 PM

Title: Add text to RichEdit control
Post by: TimoVJL on June 14, 2010, 03:19:05 PM
Is there another/better way to add text to RichEdit-control ?

Code: [Select]
void Add2REdit(HWND hEdit, char *szText)
{
SETTEXTEX st = {ST_SELECTION, CP_ACP};

SendMessage(hEdit, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)szText);
}
An example:
Code: [Select]
Add2REdit(hEdit, "{\\rtf\\ansi\\deff0{\\fonttbl{\\f0 New Courier;}}Text1\\par \\b Text2\\par ");
Add2REdit(hEdit, "{\\rtf\\ansi\\deff0{\\fonttbl{\\f0 New Courier;}}Text3\\par \\b Text4\\par ");