I’m trying to realize a code to add the syntax-highlighting to the richedit of winapi, so I search ranges of text that I must colorize, but if I select the range with the EM_EXSETSEL message to format with the EM_SETCHARFORMAT message, it’s very slow and all is saw by users. How I can change the character formatting more quickly ?
Share
I did it via RTF: it’s a markup language, conceptually similar to HTML. Insert the color directives at once and reload the buffer. To be true I used MFC, but I think that CRichEdit it’s a thin layer that adds no further functionality (apart framework integration, of course). Here some code (very old, I’m sorry):