// ShowMsg2.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "ShowMsg2.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // ShowMsg2 dialog ShowMsg2::ShowMsg2(CWnd* pParent /*=NULL*/) : CDialog(ShowMsg2::IDD, pParent) { //{{AFX_DATA_INIT(ShowMsg2) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT } void ShowMsg2::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(ShowMsg2) DDX_Control(pDX, IDCANCEL, m_btn1); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(ShowMsg2, CDialog) //{{AFX_MSG_MAP(ShowMsg2) ON_WM_CTLCOLOR() ON_WM_LBUTTONDOWN() //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // ShowMsg2 message handlers BOOL ShowMsg2::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here m_font.CreatePointFont (120, "ËÎÌå"); m_btn1.SetFont (&m_font); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } HBRUSH ShowMsg2::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 ShowMsg2::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y)); CDialog::OnLButtonDown(nFlags, point); }