ShowMsg3.cpp 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // ShowMsg2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "ShowMsg3.h"
  6. #ifdef _DEBUG
  7. #define new DEBUG_NEW
  8. #undef THIS_FILE
  9. static char THIS_FILE[] = __FILE__;
  10. #endif
  11. /////////////////////////////////////////////////////////////////////////////
  12. // ShowMsg2 dialog
  13. ShowMsg3::ShowMsg3(CWnd* pParent /*=NULL*/)
  14. : CDialog(ShowMsg3::IDD, pParent)
  15. , m_strMsg(_T(""))
  16. {
  17. //{{AFX_DATA_INIT(ShowMsg2)
  18. // NOTE: the ClassWizard will add member initialization here
  19. //}}AFX_DATA_INIT
  20. }
  21. void ShowMsg3::DoDataExchange(CDataExchange* pDX)
  22. {
  23. CDialog::DoDataExchange(pDX);
  24. //{{AFX_DATA_MAP(ShowMsg3)
  25. DDX_Control(pDX, IDC_STATIC_Msg, m_staticmsg);
  26. //}}AFX_DATA_MAP
  27. }
  28. BEGIN_MESSAGE_MAP(ShowMsg3, CDialog)
  29. //{{AFX_MSG_MAP(ShowMsg3)
  30. ON_WM_CTLCOLOR()
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // ShowMsg3 message handlers
  35. BOOL ShowMsg3::OnInitDialog()
  36. {
  37. CDialog::OnInitDialog();
  38. // TODO: Add extra initialization here
  39. m_font.CreatePointFont (240, "ËÎÌå");
  40. m_staticmsg.SetWindowText(m_strMsg);
  41. m_staticmsg.SetFont(&m_font);
  42. return TRUE; // return TRUE unless you set the focus to a control
  43. // EXCEPTION: OCX Property Pages should return FALSE
  44. }
  45. HBRUSH ShowMsg3::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
  46. {
  47. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  48. // TODO: Change any attributes of the DC here
  49. if(nCtlColor == CTLCOLOR_STATIC)
  50. {
  51. pDC->SetTextColor(RGB(255,0,0));
  52. }
  53. // TODO: Return a different brush if the default is not desired
  54. return hbr;
  55. }
  56. void ShowMsg3::OnOK()
  57. {
  58. CDialog::OnOK();
  59. }
  60. void ShowMsg3::OnCancel()
  61. {
  62. CDialog::OnCancel();
  63. }