diff --git a/src/os2/app.cpp b/src/os2/app.cpp index ff0d9b43ed..60bb29dcda 100644 --- a/src/os2/app.cpp +++ b/src/os2/app.cpp @@ -478,28 +478,26 @@ int wxEntry( { if (wxTheApp->OnInit()) { - nRetValue = -1; + nRetValue = wxTheApp->OnRun(); +// nRetValue = -1; } } - if (nRetValue == 0) - { - wxWindow* pTopWindow = wxTheApp->GetTopWindow(); + wxWindow* pTopWindow = wxTheApp->GetTopWindow(); - if (pTopWindow) + if (pTopWindow) + { + // Forcibly delete the window. + if (pTopWindow->IsKindOf(CLASSINFO(wxFrame)) || + pTopWindow->IsKindOf(CLASSINFO(wxDialog)) ) { - // Forcibly delete the window. - if (pTopWindow->IsKindOf(CLASSINFO(wxFrame)) || - pTopWindow->IsKindOf(CLASSINFO(wxDialog)) ) - { - pTopWindow->Close(TRUE); - wxTheApp->DeletePendingObjects(); - } - else - { - delete pTopWindow; - wxTheApp->SetTopWindow(NULL); - } + pTopWindow->Close(TRUE); + wxTheApp->DeletePendingObjects(); + } + else + { + delete pTopWindow; + wxTheApp->SetTopWindow(NULL); } } wxTheApp->OnExit(); diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 44a4888de1..50a4cea7f1 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -344,6 +344,14 @@ void wxFrame::DoShowWindow( { HWND hClient; + // + // Send anything to initialize the frame + // + ::WinSendMsg( GetHwnd() + ,WM_UPDATEFRAME + ,(MPARAM)FCF_MENU + ,(MPARAM)0 + ); hClient = ::WinWindowFromID(GetHwnd(), FID_CLIENT); ::WinShowWindow(GetHwnd(), (BOOL)bShowCmd); ::WinShowWindow(hClient, (BOOL)bShowCmd); @@ -898,6 +906,7 @@ bool wxFrame::OS2Create( ,SWP_SIZE | SWP_MOVE )) return FALSE; + WinQueryWindowPos(hClient, &vSwp); return TRUE; } // end of wxFrame::OS2Create