LRESULT CMiniPieFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { CAppInfo info; // Full screen mode delayed restoration bool bFull = false; info.Restore(bFull, L"Full"); if (bFull) PostMessage(WM_COMMAND, ID_VIEW_FULLSCREEN); CreateSimpleCEMenuBar(); #ifdef WIN32_PLATFORM_WFSP // SmartPhone AtlActivateBackKey(m_hWndCECommandBar); #endif UIAddToolBar(m_hWndCECommandBar); SetCommandButton(ID_APP_EXIT); // StatusBar state restoration bool bVisible = true; info.Restore(bVisible, L"Status"); DWORD dwStyle = WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | CCS_TOP; if (bVisible) dwStyle |= WS_VISIBLE; // StatusBar creation CreateSimpleStatusBar(ATL_IDS_IDLEMESSAGE, dwStyle); UIAddStatusBar(m_hWndStatusBar); UISetCheck(ID_VIEW_STATUS_BAR, bVisible); // Browser view creation m_hWndClient = m_browser.Create(m_hWnd, NULL, _T("Microsoft.PIEDocView"), WS_CHILD | WS_VISIBLE | WS_BORDER, 0, ID_BROWSER); ATLVERIFY(SUCCEEDED(m_browser.QueryControl(&m_spIWebBrowser2))); ATLVERIFY(SUCCEEDED(AtlAdviseSinkMap(this, true))); // Navigation menu initialization UIEnable(IDM_BACK, FALSE); UIEnable(IDM_FORWARD, FALSE); UIEnable(IDM_STOP, FALSE); UIEnable(IDM_REFRESH, FALSE); #ifdef WIN32_PLATFORM_PSPC // PPC Address bar state restoration VARIANT_BOOL vb = ATL_VARIANT_TRUE; info.Restore(vb, L"Address"); m_spIWebBrowser2->put_AddressBar(vb); UISetCheck(ID_VIEW_ADDRESSBAR, vb == ATL_VARIANT_TRUE); #endif // register object for message filtering and idle updates CMessageLoop* pLoop = _Module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); pLoop->AddIdleHandler(this); return 0; }
LRESULT MainFrame::OnCreate(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/) { EnteredNewSystem(); #ifdef UNDER_CE CreateSimpleCEMenuBar(IDR_MAINFRAME, SHCMBF_HMENU); // create tab view m_hWndClient = m_tabView.Create(m_hWnd, rcDefault); #else CreateSimpleToolBar(); CreateSimpleStatusBar(); CRect rcWindow = rcDefault; // TODO m_hWndClient = m_tabView.Create(m_hWnd, rcWindow, NULL, WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN, WS_EX_CLIENTEDGE); // CMenuHandle menuMain = GetMenu(); // m_tabView.SetWindowMenu(menuMain.GetSubMenu(WINDOW_MENU_POSITION)); #endif // create tab windows m_marketView.Create(m_tabView); m_planetInfoView.Create(m_tabView); m_shortRangeMapView.Create(m_tabView); m_tabView.AddPage(m_shortRangeMapView, _T("Local Map")); m_tabView.AddPage(m_marketView, _T("Market")); m_tabView.AddPage(m_planetInfoView, _T("Planet Info")); m_tabView.SetActivePage(0); // register object for message filtering and idle updates CMessageLoop* pLoop = _Module.GetMessageLoop(); ATLASSERT(pLoop != NULL); pLoop->AddMessageFilter(this); pLoop->AddIdleHandler(this); return 0; }