Change highlight color of selected text in RichEdit

How to change the color of selected text in a RichEdit control when text is selected? SetSysColor () can do this, but it globally changes the highlight color.

Setting CHARFORMAT2 with SCF_SELECTION and sending EM_SETCHARFORMAT changes the font color and background. But this is only visible after you deselect the same range. This is not very useful, as I want it to be the original color again as soon as something is canceled.

So how really puzzled me.

+2
source share
1 answer

Just subclass it (long published in google groups, C / Winapi code)

0
source

All Articles