I am using an animation control in my MFC dialog box to display an animation. I want to change the background color of this control to match the background color of my dialog box, which is white. I have tried using the OnCtlColor() method, but apparently the animation control does not invoke OnCtlColor().
Thanks for the reply. And yes that's what the problem exactly is. There isn't anything such as a "WM_CTLCOLORANIMATION". I had tried what the msdn article says with no luck before. But then i tried this and it solved my problem
1 2 3 4 5 6 7 8 9 10
HBRUSH CFinishPage::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = __super::OnCtlColor(pDC, pWnd, nCtlColor);
pDC->SetBkMode(TRANSPARENT);
pDC->SetBkColor(RGB(255,255,255));
hbr = (HBRUSH) mWhiteBrush;
// TODO: Return a different brush if the default is not desired
return hbr;
}
This paints the entire background white. In most cases that my not be desirable but works for me.