I am creating a rich edit text box like so:
const char *testText = "Hello \\bworld!";
LoadLibrary("riched20.dll");
hwndoutbox = CreateWindowEx(
ES_SUNKEN,
RICHEDIT_CLASS,
testText,
WS_BORDER | WS_VISIBLE | WS_CHILD,
0, 40, 300, 300,
hwnd, 0, hInstance, NULL);
The intended result is to display ‘Hello World’ with the ‘World’ in bold.
What am I doing wrong?
I have a hunch that \b might be an escape code for something, but i cant find much info to back that up
You need to go and have a look at the specification for RTF. For a start, RTF data has a header, and you aren’t including that.
In fact, Wikipedia’s page on RTF (here) might have been a good place for you to start. It includes this example text:
… which is a string with a bold word.
The “rich edit control” is a control designed to render RTF.