]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
don't give empty message box if Parse(FALSE) was called and there was --help on the...
[wxWidgets.git] / src / msw / app.cpp
index 796ee13256bb08e52c39e4fb783134af53878080..8f9782d2d1c1d1e812704f1c9f73e51e8babb978 100644 (file)
     #define _WIN32_IE 0x0200
 #endif
 
-#if _WIN32_IE >= 0x0300 && !defined(__MINGW32__)
+#if _WIN32_IE >= 0x0300 && \
+    (!defined(__MINGW32__) || wxCHECK_W32API_VERSION( 2, 0 ))
     #include <shlwapi.h>
 #endif
 
@@ -473,7 +474,9 @@ void wxApp::ConvertToStandardCommandArgs(const char* lpCmdLine)
     wxString name;
     wxFileName::SplitPath(argv[0], NULL, &name, NULL);
 
-    SetAppName(name);
+    // but don't override the name already set by the user code, if any
+    if ( GetAppName().empty() )
+        SetAppName(name);
 
     // copy all the other arguments to wxApp::argv[]
     for ( int i = 1; i < argc; i++ )
@@ -700,22 +703,8 @@ int wxEntry(WXHINSTANCE hInstance,
         wxLog::SetTimestamp(NULL);
 #endif
 
-        int retValue = 0;
-
-        // it is common to create a modal dialog in OnInit() (to ask/notify the
-        // user about something) but it wouldn't work if we don't change the
-        // "exit on delete last frame" flag here as when this dialog is
-        // deleted, the app would terminate (it was the last top level window
-        // as the main frame wasn't created yet!), so disable this behaviour
-        // temproarily
-        bool exitOnLastFrameDelete = wxTheApp->GetExitOnFrameDelete();
-        wxTheApp->SetExitOnFrameDelete(FALSE);
-
         // init the app
-        retValue = wxEntryInitGui() && wxTheApp->OnInit() ? 0 : -1;
-
-        // restore the old flag value
-        wxTheApp->SetExitOnFrameDelete(exitOnLastFrameDelete);
+        int retValue = wxEntryInitGui() && wxTheApp->OnInit() ? 0 : -1;
 
         if ( retValue == 0 )
         {
@@ -985,8 +974,8 @@ bool wxApp::ProcessIdle()
 
 void wxApp::ExitMainLoop()
 {
-    // VZ: why not ::PostQuitMessage()?
-    m_keepGoing = FALSE;
+    // this will set m_keepGoing to FALSE a bit later
+    ::PostQuitMessage(0);
 }
 
 bool wxApp::Pending()