Question

How do I change the color of selected text in a RichEdit control, while the text is being selected? SetSysColor() can do it, but that changes the Highlight-color globally.

Setting a CHARFORMAT2 with SCF_SELECTION, and sending a EM_SETCHARFORMAT does change the font and background color. But is only visible once you deselect the same range. That's not really helpful, since I want it to be the original color again once something is deselected.

So, how it's really done puzzles me.

No correct solution

OTHER TIPS

Simply subclass it (posted a long time ago on google groups, C/Winapi code)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top