void MainFrameBase::SetupMDIClient() { m_tabbedChildWindow.SetReflectNotifications(true); m_tabbedChildWindow.SetTabStyles(CTCS_TOOLTIPS | CTCS_SCROLL); m_tabbedChildWindow.Create(m_hWnd, rcDefault); m_tabbedChildWindow.ModifyStyleEx(WS_EX_CLIENTEDGE, 0); CreateMDIClient(); // subclass mdi client m_tabbedClient.SetTabOwnerParent(m_hWnd); ATLVERIFY(TRUE == m_tabbedClient.SubclassWindow(m_hWndMDIClient)); m_CmdBar.SetMDIClient(m_hWndMDIClient); }
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) { g_pMainFrame = this; // create command bar window HWND hWndCmdBar = m_CmdBar.Create(m_hWnd, rcDefault, NULL, ATL_SIMPLE_CMDBAR_PANE_STYLE); // attach menu m_CmdBar.AttachMenu(GetMenu()); // load command bar images m_CmdBar.LoadImages(IDR_MAINFRAME); // remove old menu SetMenu(NULL); HWND hWndToolBar = CreateSimpleToolBarCtrl(m_hWnd, IDR_MAINFRAME, FALSE, ATL_SIMPLE_TOOLBAR_PANE_STYLE); CreateSimpleReBar(ATL_SIMPLE_REBAR_NOBORDER_STYLE); AddSimpleReBarBand(hWndCmdBar); AddSimpleReBarBand(hWndToolBar, NULL, TRUE); //CreateSimpleStatusBar(); int anPanes[] = { ID_DEFAULT_PANE, ID_PANE_TILE_GRID };//, IDPANE_STATUS, IDPANE_CAPS_INDICATOR }; m_hWndStatusBar = m_wndStatusBar.Create ( *this ); UIAddStatusBar ( m_hWndStatusBar ); m_wndStatusBar.SetPanes(anPanes, _countof(anPanes), false); CreateMDIClient(); m_CmdBar.SetMDIClient(m_hWndMDIClient); UIAddToolBar(hWndToolBar); UISetCheck(ID_VIEW_TOOLBAR, 1); UISetCheck(ID_VIEW_STATUS_BAR, 1); // register object for message filtering and idle updates CMessageLoop* pLoop = _Module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); pLoop->AddIdleHandler(this); return 0; }