www.pudn.com > 14751_AdoRWAccess.rar > About.cpp


////////////////////////////////////////////////////////////////////////////// 
//类名:About 
//功能:"关于"对话框 
//作者:徐景周(jingzhou_xu@163.net) 
//组织:未来工作室(Future Studio) 
//日期:2002.12.10 
///////////////////////////////////////////////////////////////////////////// 
#include "stdafx.h" 
#include "AdoRWAccess.h" 
#include "About.h" 
 
#ifdef _DEBUG 
#define new DEBUG_NEW 
#undef THIS_FILE 
static char THIS_FILE[] = __FILE__; 
#endif 
 
///////////////////////////////////////////////////////////////////////////// 
// About dialog 
 
 
About::About(CWnd* pParent /*=NULL*/) 
	: CDialog(About::IDD, pParent) 
{ 
	//{{AFX_DATA_INIT(About) 
		// NOTE: the ClassWizard will add member initialization here 
	//}}AFX_DATA_INIT 
} 
 
 
void About::DoDataExchange(CDataExchange* pDX) 
{ 
	CDialog::DoDataExchange(pDX); 
	//{{AFX_DATA_MAP(About) 
	DDX_Control(pDX, IDC_FLAG, m_Flag); 
	DDX_Control(pDX, IDC_STATIC_MAIL, m_Mail); 
	DDX_Control(pDX, IDOK, m_OK); 
	//}}AFX_DATA_MAP 
} 
 
 
BEGIN_MESSAGE_MAP(About, CDialog) 
	//{{AFX_MSG_MAP(About) 
	ON_WM_CTLCOLOR() 
	//}}AFX_MSG_MAP 
END_MESSAGE_MAP() 
 
///////////////////////////////////////////////////////////////////////////// 
// About message handlers 
////////////////////////////////////////////////////////////////////////////// 
//名称:OnInitDialog 
//功能:初始化"关于"对话框 
//作者:徐景周(jingzhou_xu@163.net) 
//组织:未来工作室(Future Studio) 
//日期:2002.12.1 
///////////////////////////////////////////////////////////////////////////// 
BOOL About::OnInitDialog()  
{ 
	CDialog::OnInitDialog(); 
	 
	//设置“关于”对话框的XP风格按钮显示 
	m_OK.OffsetColor(CButtonST::BTNST_COLOR_BK_IN, 30); 
	m_OK.SetBkColor(RGB(162,189,252)); 
	m_OK.SetRounded(TRUE); 
	m_OK.SetTooltipText(_T("关闭")); 
 
	//加入EMAIL的超连接 
    m_Mail.SetURL(_T("mailto:jingzhou_xu@163.net")); 
	m_Mail.SetUnderline(FALSE);	 
 
	//显示动态GIF图像logo 
	if(m_Flag.Load(MAKEINTRESOURCE(IDR_FLAG),_T("GIF"))) 
	{ 
		m_Flag.SetBkColor(RGB(160,180,220)); 
		m_Flag.Draw();	 
	} 
	 
	return TRUE;  // return TRUE unless you set the focus to a control 
	              // EXCEPTION: OCX Property Pages should return FALSE 
} 
 
////////////////////////////////////////////////////////////////////////////// 
//名称:OnCtlColor 
//功能:设置各控件前景、背景色 
//作者:徐景周(jingzhou_xu@163.net) 
//组织:未来工作室(Future Studio) 
//日期:2002.12.10 
///////////////////////////////////////////////////////////////////////////// 
HBRUSH About::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)  
{ 
	HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor); 
	 
	if(nCtlColor==CTLCOLOR_LISTBOX) 
	{ 
		//pDC->SetBkMode(TRANSPARENT); 
		pDC->SetTextColor(RGB(0,0,0)); 
		pDC->SetBkColor(RGB(233,233,220)); 
		HBRUSH b=CreateSolidBrush(RGB(233,233,220)); 
		return b; 
	} 
	else if(nCtlColor==CTLCOLOR_SCROLLBAR) 
	{ 
		//pDC->SetBkMode(TRANSPARENT); 
		pDC->SetTextColor(RGB(0,0,0)); 
		pDC->SetBkColor(RGB(233,233,220)); 
		HBRUSH b=CreateSolidBrush(RGB(233,233,220)); 
		return b; 
	} 
	else if(nCtlColor==CTLCOLOR_EDIT) 
	{ 
		//pDC->SetBkMode(TRANSPARENT); 
		pDC->SetTextColor(RGB(0,0,0)); 
		pDC->SetBkColor(RGB(233,233,220)); 
		HBRUSH b=CreateSolidBrush(RGB(233,233,220)); 
		return b; 
	} 
	else if(nCtlColor==CTLCOLOR_STATIC) 
	{ 
		pDC->SetTextColor(RGB(0,0,0)); 
		pDC->SetBkColor(RGB(160,180,220)); 
		HBRUSH b=CreateSolidBrush(RGB(160,180,220)); 
		return b; 
	} 
	else if(nCtlColor==CTLCOLOR_DLG) 
	{ 
		pDC->SetTextColor(RGB(0,0,0)); 
		pDC->SetBkColor(RGB(160,180,220)); 
		HBRUSH b=CreateSolidBrush(RGB(160,180,220)); 
		return b; 
	} 
	 
	return hbr; 
}