LRESULT CMainWindow::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { try { ModifyStyle(WS_CAPTION,WS_CLIPSIBLINGS | WS_CLIPCHILDREN); if(!RegisterSkin(_T("mainwindow.xml"),0,this)) return 0; GetPaintMgr()->AddNotifier(this); RECT rcClient; ::GetClientRect(*this, &rcClient); ::SetWindowPos(*this, NULL, rcClient.left, rcClient.top, rcClient.right - rcClient.left, \ rcClient.bottom - rcClient.top, SWP_FRAMECHANGED); CLogin* pLogin = new CLogin(); pLogin->Create(m_hWnd,NULL,UI_WNDSTYLE_DIALOG, WS_EX_WINDOWEDGE); pLogin->CenterWindow(); pLogin->BringWindowToTop(); pLogin->ShowModal(); } catch (...) { throw _T("CMainWindow::OnCreate"); } return 0; }