// use CWnd::OnCtlColor

HBRUSH CSSUtilityDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
   // Call the base class implementation first! Otherwise, it may
   // undo what we're trying to accomplish here.

    if(nCtlColor==CTLCOLOR_DLG){
        HBRUSH hbr1;   
       // 這裡放你要的顏色 COLORREF m_curColor = RGB(255,0,0);
        COLORREF m_curColor = RGB(0,0,0);
        hbr1=CreateSolidBrush(m_curColor); 
        return hbr1;
    }

}

// class define

virtual HBRUSH CSSUtilityDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) ;

//


BEGIN_MESSAGE_MAP(CSSUtilityDlg, CDialog)
    …..

    ON_WM_CTLCOLOR()    // ADD THIS LINE
    //}}AFX_MSG_MAP

END_MESSAGE_MAP()


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 gordenhao 的頭像
    gordenhao

    高登

    gordenhao 發表在 痞客邦 留言(0) 人氣()