]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/app.cpp
test
[wxWidgets.git] / src / msw / app.cpp
index 3528af8915a0543eafbe717db1f6991b9dbcef02..0b947a540974716b12f63b748328cf06709b090f 100644 (file)
@@ -100,7 +100,6 @@ extern wxList WXDLLEXPORT wxPendingDelete;
 extern void wxSetKeyboardHook(bool doIt);
 extern wxCursor *g_globalCursor;
 
-HINSTANCE wxhInstance = 0;
 MSG s_currentMsg;
 wxApp *wxTheApp = NULL;
 
@@ -1217,11 +1216,16 @@ void wxWakeUpIdle()
 {
     // Send the top window a dummy message so idle handler processing will
     // start up again.  Doing it this way ensures that the idle handler
-    // wakes up in the right thread.
+    // wakes up in the right thread (see also wxWakeUpMainThread() which does
+    // the same for the main app thread only)
     wxWindow *topWindow = wxTheApp->GetTopWindow();
-    if ( topWindow ) {
-        HWND hWnd = (HWND)topWindow->GetHWND();
-        ::PostMessage(hWnd, WM_NULL, 0, 0);
+    if ( topWindow )
+    {
+        if ( !::PostMessage(GetHwndOf(topWindow), WM_NULL, 0, 0) )
+        {
+            // should never happen
+            wxLogLastError("PostMessage(WM_NULL)");
+        }
     }
 }
 
@@ -1250,17 +1254,6 @@ wxApp::GetStdIcon(int which) const
     }
 }
 
-
-HINSTANCE wxGetInstance()
-{
-    return wxhInstance;
-}
-
-void wxSetInstance(HINSTANCE hInst)
-{
-    wxhInstance = hInst;
-}
-
 // For some reason, with MSVC++ 1.5, WinMain isn't linked in properly
 // if in a separate file. So include it here to ensure it's linked.
 #if (defined(__VISUALC__) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__))