提交 | 用户 | age
4b03ae 1 
Q 2 // MainFrm.cpp: CMainFrame 类的实现
3 //
4
5 #include "pch.h"
6 #include "framework.h"
7 #include "MFCApplication3.h"
8
9 #include "MainFrm.h"
10
11 #ifdef _DEBUG
12 #define new DEBUG_NEW
13 #endif
14
15 // CMainFrame
16
17 IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
18
19 BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
20     ON_WM_CREATE()
21 END_MESSAGE_MAP()
22
23 static UINT indicators[] =
24 {
25     ID_SEPARATOR,           // 状态行指示器
26     ID_INDICATOR_CAPS,
27     ID_INDICATOR_NUM,
28     ID_INDICATOR_SCRL,
29 };
30
31 // CMainFrame 构造/析构
32
33 CMainFrame::CMainFrame() noexcept
34 {
35     // TODO: 在此添加成员初始化代码
36 }
37
38 CMainFrame::~CMainFrame()
39 {
40 }
41
42 int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
43 {
44     if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
45         return -1;
46
47     if (!m_wndStatusBar.Create(this))
48     {
49         TRACE0("未能创建状态栏\n");
50         return -1;      // 未能创建
51     }
52     m_wndStatusBar.SetIndicators(indicators, sizeof(indicators)/sizeof(UINT));
53
54     return 0;
55 }
56
57 BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
58 {
59     if( !CMDIFrameWnd::PreCreateWindow(cs) )
60         return FALSE;
61     // TODO: 在此处通过修改
62     //  CREATESTRUCT cs 来修改窗口类或样式
63
64     return TRUE;
65 }
66
67 // CMainFrame 诊断
68
69 #ifdef _DEBUG
70 void CMainFrame::AssertValid() const
71 {
72     CMDIFrameWnd::AssertValid();
73 }
74
75 void CMainFrame::Dump(CDumpContext& dc) const
76 {
77     CMDIFrameWnd::Dump(dc);
78 }
79 #endif //_DEBUG
80
81
82 // CMainFrame 消息处理程序
83