How highlight keywords in rich edit control?
Posted on 1997-09-21
This is a question relating to a program being written in C (Win32SDK) for Win95/NT4. I want to set up a rich edit control so that if the user types one of a number of keywords, the word will change color - much as in a program script. Initial thoughts are that a lot of programming will be involved - a new thread to stream out the text on each change/update, a routine to check for keywords, select them (selection hidden) and use a CHARFORMAT on the selection before restoring caret to where it was. Or is there a simpler way?! I feel it probably needs a thread because if there is a lot of text, it may take a while to check it all. But streaming it out on each change seems over the top; however WM_GETTEXT would only get the first 64kb or so. Any ideas? Thanks!