NO

Author Topic: Add text to RichEdit control  (Read 5198 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Add text to RichEdit control
« 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 ");
« Last Edit: June 14, 2010, 07:08:50 PM by timovjl »
May the source be with you