// ShowMsg2.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "ShowMsg3.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // ShowMsg2 dialog ShowMsg3::ShowMsg3(CWnd* pParent /*=NULL*/) : CDialog(ShowMsg3::IDD, pParent) , m_strMsg(_T("")) { //{{AFX_DATA_INIT(ShowMsg2) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void ShowMsg3::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(ShowMsg3) DDX_Control(pDX, IDC_STATIC_Msg, m_staticmsg); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(ShowMsg3, CDialog) //{{AFX_MSG_MAP(ShowMsg3) ON_WM_CTLCOLOR() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // ShowMsg3 message handlers BOOL ShowMsg3::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_font.CreatePointFont (240, "ËÎÌå"); m_staticmsg.SetWindowText(m_strMsg); m_staticmsg.SetFont(&m_font); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } HBRUSH ShowMsg3::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_STATIC) { pDC->SetTextColor(RGB(255,0,0)); } // TODO: Return a different brush if the default is not desired return hbr; } void ShowMsg3::OnOK() { CDialog::OnOK(); } void ShowMsg3::OnCancel() { CDialog::OnCancel(); }