]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
suppressed wrong debug error messages from SetFocus
[wxWidgets.git] / src / msw / window.cpp
index 3dd8c2240ee0cfb2db9222586af92720a6d5e691..5f4c38e7fe760dec7befbba0420d16ad358b0970 100644 (file)
@@ -450,23 +450,18 @@ void wxWindowMSW::SetFocus()
 
     if ( !::SetFocus(hWnd) )
     {
+#if defined(__WXDEBUG__) && !defined(__WXMICROWIN__)
         // was there really an error?
-#ifndef __WXMICROWIN__
         DWORD dwRes = ::GetLastError();
-#else
-
-        DWORD dwRes = 0;
-#endif
         if ( dwRes )
         {
-            wxLogApiError(_T("SetFocus"), dwRes);
+            HWND hwndFocus = ::GetFocus();
+            if ( hwndFocus != hWnd )
+            {
+                wxLogApiError(_T("SetFocus"), dwRes);
+            }
         }
-
-        // VZ: just why does this happen sometimes?? any idea?
-#if 0
-        HWND hwndFocus = ::GetFocus();
-        wxASSERT_MSG( hwndFocus == hWnd, _T("SetFocus() didn't work?") );
-#endif // 0
+#endif // Debug
     }
 }