From my own post fooobar.com/questions/1691633 / ... I can guarantee that I did this work. I used this approach to implement themes / skins in a commercial application.
You need to add the OnCtlColor method to the Basic_Window class. In the .h file, add the Basic_Window class:
const CBrush m_BackgroundBrush;
and
afx_msg HBRUSH OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor);
.cpp
Basic_Window::Basic_Window()
: m_BackgroundBrush(RGB(255,255,255))
{
}
HBRUSH Basic_Window::OnCtlColor( CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
if(some_exception)
return __super::OnCtlColor( pDC, pWnd, nCtlColor);
return (HBRUSH) m_BackgroundBrush.GetSafeHandle();
}
some_exception
, , . , , nCtlColor
.
ON_WM_CTLCOLOR()
.