
Colored background and text in a CEdit control
I am trying to use MFC's message reflection to handle control coloring
in my CEdit-derived class. However, my CtlColor member function is
never called. There are two catches to the way I'm doing this that
might be responsible. First, the parent window is derived from
CScrollView, not CDialog, though the documentation states that any
window derived from CWnd is fine. Second, the CEdit-derived object is
implemented and created within a User DLL (the view window lives
within the application itself). That means it has it's own window
mapping pool, which is probably the problem.
This is just ridiculous. I want my control to be able to control, no
pun intended, it's own coloring. I do not want the view window to
even know this window exists! Apparently there is no way to do this
with the CEdit class. Microsoft really screwed up with both the whole
WM_CTLCOLOR implementation and with MFC's CEdit implementation. There
should be a simple way to tell the control to set the text and
background colors.
I guess I'll be rolling my own edit control unless someone here has
some arcane knowledge for me.
Brent