ShowMsg2.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // ShowMsg2.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ylgl.h"
  5. #include "ShowMsg2.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. ShowMsg2::ShowMsg2(CWnd* pParent /*=NULL*/)
  14. : CDialog(ShowMsg2::IDD, pParent)
  15. {
  16. //{{AFX_DATA_INIT(ShowMsg2)
  17. // NOTE: the ClassWizard will add member initialization here
  18. //}}AFX_DATA_INIT
  19. }
  20. void ShowMsg2::DoDataExchange(CDataExchange* pDX)
  21. {
  22. CDialog::DoDataExchange(pDX);
  23. //{{AFX_DATA_MAP(ShowMsg2)
  24. DDX_Control(pDX, IDCANCEL, m_btn1);
  25. //}}AFX_DATA_MAP
  26. }
  27. BEGIN_MESSAGE_MAP(ShowMsg2, CDialog)
  28. //{{AFX_MSG_MAP(ShowMsg2)
  29. ON_WM_CTLCOLOR()
  30. ON_WM_LBUTTONDOWN()
  31. //}}AFX_MSG_MAP
  32. END_MESSAGE_MAP()
  33. /////////////////////////////////////////////////////////////////////////////
  34. // ShowMsg2 message handlers
  35. BOOL ShowMsg2::OnInitDialog()
  36. {
  37. CDialog::OnInitDialog();
  38. // TODO: Add extra initialization here
  39. m_font.CreatePointFont (120, "ËÎÌå");
  40. m_btn1.SetFont (&m_font);
  41. return TRUE; // return TRUE unless you set the focus to a control
  42. // EXCEPTION: OCX Property Pages should return FALSE
  43. }
  44. HBRUSH ShowMsg2::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
  45. {
  46. HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
  47. // TODO: Change any attributes of the DC here
  48. if(nCtlColor == CTLCOLOR_STATIC )
  49. {
  50. pDC->SetTextColor (RGB(255,0,0));
  51. }
  52. // TODO: Return a different brush if the default is not desired
  53. return hbr;
  54. }
  55. void ShowMsg2::OnLButtonDown(UINT nFlags, CPoint point)
  56. {
  57. // TODO: Add your message handler code here and/or call default
  58. SendMessage(WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(point.x, point.y));
  59. CDialog::OnLButtonDown(nFlags, point);
  60. }