How to change background color in static text visual studio?

Viewed 1579

I am trying to change background color of static text in our project. We use BCG library also.

In h. file I have

afx_msg HBRUSH CtlColor(CDC * pDC, CWnd * pWnd, UINT nCtlColor);
COLORREF m_bckNewsClr;

In cpp. I have:

m_bckNewsClr = RGB(255, 255, 255);

HBRUSH CStartPage::CtlColor(CDC * pDC, CWnd * pWnd, UINT nCtlColor)
{
    pWnd->GetDlgItem(IDC_STATIC_NEWS_CAPTION_1);
    pDC->SetBkColor(m_bckNewsClr);
    return (HBRUSH)m_Brush.GetSafeHandle();
}

In massage map:

ON_WM_CTLCOLOR()

Anyway, it is even not visible the function CtlColor, when I put the breakpoint.

Does someone know how to change this backgound static text in this case?

1 Answers
Related