]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
use standard colour for the selected tree item text as well as background
[wxWidgets.git] / src / msw / app.cpp
index 598355cff1ec36a84c51dad5eaa8be0fedd6e2ec..a6ba1ee020db779c6967d83b57bc7e9c6723d706 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
 
@@ -338,8 +339,6 @@ bool wxApp::RegisterWindowClasses()
     if ( !RegisterClass(&wndclass) )
     {
         wxLogLastError(wxT("RegisterClass(frame)"));
-
-        return FALSE;
     }
 
     // "no redraw" frame
@@ -349,8 +348,6 @@ bool wxApp::RegisterWindowClasses()
     if ( !RegisterClass(&wndclass) )
     {
         wxLogLastError(wxT("RegisterClass(no redraw frame)"));
-
-        return FALSE;
     }
 
     // Register the MDI frame window class.
@@ -361,8 +358,6 @@ bool wxApp::RegisterWindowClasses()
     if ( !RegisterClass(&wndclass) )
     {
         wxLogLastError(wxT("RegisterClass(MDI parent)"));
-
-        return FALSE;
     }
 
     // "no redraw" MDI frame
@@ -372,8 +367,6 @@ bool wxApp::RegisterWindowClasses()
     if ( !RegisterClass(&wndclass) )
     {
         wxLogLastError(wxT("RegisterClass(no redraw MDI parent frame)"));
-
-        return FALSE;
     }
 
     // Register the MDI child frame window class.
@@ -384,8 +377,6 @@ bool wxApp::RegisterWindowClasses()
     if ( !RegisterClass(&wndclass) )
     {
         wxLogLastError(wxT("RegisterClass(MDI child)"));
-
-        return FALSE;
     }
 
     // "no redraw" MDI child frame
@@ -395,8 +386,6 @@ bool wxApp::RegisterWindowClasses()
     if ( !RegisterClass(&wndclass) )
     {
         wxLogLastError(wxT("RegisterClass(no redraw MDI child)"));
-
-        return FALSE;
     }
 
     return TRUE;
@@ -712,22 +701,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 )
         {
@@ -922,16 +897,12 @@ bool wxApp::DoMessage()
             {
                 s_hadGuiLock = TRUE;
 
-                size_t count = s_aSavedMessages.Count();
+                size_t count = s_aSavedMessages.GetCount();
                 for ( size_t n = 0; n < count; n++ )
                 {
                     MSG& msg = s_aSavedMessages[n];
 
-                    if ( !ProcessMessage((WXMSG *)&msg) )
-                    {
-                        ::TranslateMessage(&msg);
-                        ::DispatchMessage(&msg);
-                    }
+                    DoMessage((WXMSG *)&msg);
                 }
 
                 s_aSavedMessages.Empty();
@@ -1001,8 +972,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()