Gg1Dlg.cpp
上传用户:wxchtg88
上传日期:2022-05-17
资源大小:3340k
文件大小:3k
源码类别:

打印编程

开发平台:

Visual C++

  1. // Gg1Dlg.cpp : 备泅 颇老
  2. //
  3. #include "stdafx.h"
  4. #include "Gg1.h"
  5. #include "Gg1Dlg.h"
  6. #include "Console.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #endif
  10. // 览侩 橇肺弊伐 沥焊俊 荤侩登绰 CAboutDlg 措拳 惑磊涝聪促.
  11. class CAboutDlg : public CDialog
  12. {
  13. public:
  14. CAboutDlg();
  15. // 措拳 惑磊 单捞磐涝聪促.
  16. enum { IDD = IDD_ABOUTBOX };
  17. protected:
  18. virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV 瘤盔涝聪促.
  19. // 备泅涝聪促.
  20. protected:
  21. DECLARE_MESSAGE_MAP()
  22. };
  23. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  24. {
  25. }
  26. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  27. {
  28. CDialog::DoDataExchange(pDX);
  29. }
  30. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  31. END_MESSAGE_MAP()
  32. // CGg1Dlg 措拳 惑磊
  33. CGg1Dlg::CGg1Dlg(CWnd* pParent /*=NULL*/)
  34. : CDialog(CGg1Dlg::IDD, pParent)
  35. {
  36. m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  37. }
  38. void CGg1Dlg::DoDataExchange(CDataExchange* pDX)
  39. {
  40. CDialog::DoDataExchange(pDX);
  41. }
  42. BEGIN_MESSAGE_MAP(CGg1Dlg, CDialog)
  43. ON_WM_SYSCOMMAND()
  44. ON_WM_PAINT()
  45. ON_WM_QUERYDRAGICON()
  46. //}}AFX_MSG_MAP
  47. ON_BN_CLICKED(IDC_BTN_GG_1, &CGg1Dlg::OnBnClickedBtnGg1)
  48. ON_WM_DESTROY()
  49. END_MESSAGE_MAP()
  50. // CGg1Dlg 皋矫瘤 贸府扁
  51. BOOL CGg1Dlg::OnInitDialog()
  52. {
  53. CDialog::OnInitDialog();
  54. // 矫胶袍 皋春俊 "沥焊..." 皋春 亲格阑 眠啊钦聪促.
  55. // IDM_ABOUTBOX绰 矫胶袍 疙飞 裹困俊 乐绢具 钦聪促.
  56. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
  57. ASSERT(IDM_ABOUTBOX < 0xF000);
  58. CMenu* pSysMenu = GetSystemMenu(FALSE);
  59. if (pSysMenu != NULL)
  60. {
  61. CString strAboutMenu;
  62. strAboutMenu.LoadString(IDS_ABOUTBOX);
  63. if (!strAboutMenu.IsEmpty())
  64. {
  65. pSysMenu->AppendMenu(MF_SEPARATOR);
  66. pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
  67. }
  68. }
  69. // 捞 措拳 惑磊狼 酒捞能阑 汲沥钦聪促. 览侩 橇肺弊伐狼 林 芒捞 措拳 惑磊啊 酒匆 版快俊绰
  70. //  橇饭烙况农啊 捞 累诀阑 磊悼栏肺 荐青钦聪促.
  71. SetIcon(m_hIcon, TRUE); // 奴 酒捞能阑 汲沥钦聪促.
  72. SetIcon(m_hIcon, FALSE); // 累篮 酒捞能阑 汲沥钦聪促.
  73. // TODO: 咯扁俊 眠啊 檬扁拳 累诀阑 眠啊钦聪促.
  74. return TRUE;  // 器目胶甫 牧飘费俊 汲沥窍瘤 臼栏搁 TRUE甫 馆券钦聪促.
  75. }
  76. void CGg1Dlg::OnSysCommand(UINT nID, LPARAM lParam)
  77. {
  78. if ((nID & 0xFFF0) == IDM_ABOUTBOX)
  79. {
  80. CAboutDlg dlgAbout;
  81. dlgAbout.DoModal();
  82. }
  83. else
  84. {
  85. CDialog::OnSysCommand(nID, lParam);
  86. }
  87. }
  88. // 措拳 惑磊俊 弥家拳 窜眠甫 眠啊且 版快 酒捞能阑 弊府妨搁
  89. //  酒贰 内靛啊 鞘夸钦聪促. 巩辑/轰 葛胆阑 荤侩窍绰 MFC 览侩 橇肺弊伐狼 版快俊绰
  90. //  橇饭烙况农俊辑 捞 累诀阑 磊悼栏肺 荐青钦聪促.
  91. void CGg1Dlg::OnPaint()
  92. {
  93. if (IsIconic())
  94. {
  95. CPaintDC dc(this); // 弊府扁甫 困茄 叼官捞胶 牧咆胶飘
  96. SendMessage(WM_ICONERASEBKGND, reinterpret_cast<WPARAM>(dc.GetSafeHdc()), 0);
  97. // 努扼捞攫飘 荤阿屈俊辑 酒捞能阑 啊款单俊 嘎娩聪促.
  98. int cxIcon = GetSystemMetrics(SM_CXICON);
  99. int cyIcon = GetSystemMetrics(SM_CYICON);
  100. CRect rect;
  101. GetClientRect(&rect);
  102. int x = (rect.Width() - cxIcon + 1) / 2;
  103. int y = (rect.Height() - cyIcon + 1) / 2;
  104. // 酒捞能阑 弊赋聪促.
  105. dc.DrawIcon(x, y, m_hIcon);
  106. }
  107. else
  108. {
  109. CDialog::OnPaint();
  110. }
  111. }
  112. // 荤侩磊啊 弥家拳等 芒阑 掺绰 悼救俊 目辑啊 钎矫登档废 矫胶袍俊辑
  113. //  捞 窃荐甫 龋免钦聪促.
  114. HCURSOR CGg1Dlg::OnQueryDragIcon()
  115. {
  116. return static_cast<HCURSOR>(m_hIcon);
  117. }
  118. void CGg1Dlg::OnBnClickedBtnGg1()
  119. {
  120. CConsole::GetInstance()->Print("text1n");
  121. CConsole::GetInstance()->Print("%d.%d.%dn", 1, 2, 3);
  122. }
  123. void CGg1Dlg::OnDestroy()
  124. {
  125. CDialog::OnDestroy();
  126. CConsole::Release();
  127. }