Visual c++ 如何在静态文本visual studio中更改背景色?
我试图改变我们项目中静态文本的背景色。我们也使用BCG库 在h。我有档案Visual c++ 如何在静态文本visual studio中更改背景色?,visual-c++,mfc,bcg,Visual C++,Mfc,Bcg,我试图改变我们项目中静态文本的背景色。我们也使用BCG库 在h。我有档案 afx_msg HBRUSH CtlColor(CDC * pDC, CWnd * pWnd, UINT nCtlColor); COLORREF m_bckNewsClr; 在cpp中。我有: m_bckNewsClr = RGB(255, 255, 255); HBRUSH CStartPage::CtlColor(CDC * pDC, CWnd * pWnd, UINT nCtlColor) { pWnd
afx_msg HBRUSH CtlColor(CDC * pDC, CWnd * pWnd, UINT nCtlColor);
COLORREF m_bckNewsClr;
在cpp中。我有:
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();
}
在按摩图中:
ON_WM_CTLCOLOR()
无论如何,当我放置断点时,函数CtlColor甚至不可见
有人知道在这种情况下如何更改此背景和静态文本吗?在\u WM\u CTLCOLOR上的
需要一个名为:
afx_msg HBRUSH OnCtlColor(
CDC* pDC,
CWnd* pWnd,
UINT nCtlColor
);
有关如何操作的示例,请参见
而且您可以使用Spy++(如果x64目标平台:Spy++64)来发现消息是否真的是WM_CTLCOLOR
。我怀疑在具体案例中是WM\u ctlcolorstic
。有关\u WM\u CTLCOLOR上的的更多指导将消息重定向到OnCtlColor