www.pudn.com > xxmpx_sjs.rar > FirstDlg.cpp


// FirstDlg.cpp : implementation file 
// 
 
#include "stdafx.h" 
#include "xxmpx.h" 
#include "FirstDlg.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
const COLORREF CLOUDBLUE = RGB(128, 184, 223); 
///////////////////////////////////////////////////////////////////////////// 
// FirstDlg dialog 
 
 
FirstDlg::FirstDlg(CWnd* pParent /*=NULL*/) 
	: CDialog(FirstDlg::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(FirstDlg) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
} 
 
 
void FirstDlg::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(FirstDlg) 
		// NOTE: the ClassWizard will add DDX and DDV calls here 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(FirstDlg, CDialog) 
	//{{AFX_MSG_MAP(FirstDlg) 
	ON_WM_CTLCOLOR() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// FirstDlg message handlers 
 
//-----------改变对话框的背景色 
 
HBRUSH FirstDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)  
{ 
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); 
	 
	// TODO: Change any attributes of the DC here 
  	if (nCtlColor != CTLCOLOR_EDIT && nCtlColor != CTLCOLOR_LISTBOX) 
	{ 
   		pDC->SetBkMode(TRANSPARENT); 
     	HBRUSH B = CreateSolidBrush(CLOUDBLUE);  
     	return (HBRUSH) B; 
 	}  
 
	 
	// TODO: Return a different brush if the default is not desired 
	return hbr; 
}