| 40 | } |
| 41 | |
| 42 | int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) |
| 43 | { |
| 44 | if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1) |
| 45 | return -1; |
| 46 | |
| 47 | if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, |
| 48 | WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_GRIPPER | |
| 49 | CBRS_TOOLTIPS | CBRS_FLYBY | |
| 50 | CBRS_SIZE_DYNAMIC) || |
| 51 | !m_wndToolBar.LoadToolBar(IDR_MAINFRAME)) { |
| 52 | TRACE0("Failed to create toolbar\n"); |
| 53 | return -1; // fail to create |
| 54 | } |
| 55 | |
| 56 | if (!m_wndStatusBar.Create(this) || |
| 57 | !m_wndStatusBar.SetIndicators(indicators, |
| 58 | sizeof(indicators) / sizeof(UINT))) { |
| 59 | TRACE0("Failed to create status bar\n"); |
| 60 | return -1; // fail to create |
| 61 | } |
| 62 | // TODO: Delete these three lines if you don't want the toolbar to be |
| 63 | // dockable |
| 64 | m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY); |
| 65 | EnableDocking(CBRS_ALIGN_ANY); |
| 66 | DockControlBar(&m_wndToolBar); |
| 67 | |
| 68 | return 0; |
| 69 | } |
| 70 | |
| 71 | BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs) |
| 72 | { |