Changing the color of Windows controls gives them a fancy look and feel.The magazine CDs etc give some  free wares like mp3 players,video cutters etc to us.
hope most of them noted their amazing colors.. like magenta,violet etc.. 🙂
how can we change the usual colors and shape of dialog?


Create one Dialog based application.

This can be done in MFC by using simple codes.

hope this code will definitely help you.

// CTestColorDlg dialog

class CTestColorDlg : public CDialog
// Construction
CTestColorDlg(CWnd* pParent = NULL);    // standard constructor

// Dialog Data
// NOTE: the ClassWizard will add data members here

// ClassWizard generated virtual function overrides
virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support

// Implementation
HICON m_hIcon;
CBrush m_brush;

// Generated message map functions
virtual BOOL OnInitDialog();
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);

Then, add this line in the OnInitDialog function
// CTestColorDlg message handlers

BOOL CTestColorDlg::OnInitDialog()

// Set the icon for this dialog.  The framework does this automatically
//  when the application’s main window is not a dialog
SetIcon(m_hIcon, TRUE);            // Set big icon
SetIcon(m_hIcon, FALSE);        // Set small icon

// TODO: Add extra initialization here
m_brush.CreateSolidBrush(RGB(255, 0, 255));
CRect rect;
int w = rect.Width();
int h = rect.Height();

CRgn rgn1;

rgn1.CreateEllipticRgn(1, 1, w, h/2 + 30);
SetWindowRgn(static_cast<HRGN>(rgn1.GetSafeHandle()), TRUE);

return TRUE;  // return TRUE  unless you set the focus to a control

Then, add the windows Message Handler WM_CTLCOLOR and add the following line.

HBRUSH CTestColorDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);

// TODO: Change any attributes of the DC here

hbr = m_brush;
return hbr;


Just compile and go..
use one anti glare screen in front of the monitor.. 🙂
hows that..?? 🙂

“No one is perfect until you fall in love with them!”