]> git.saurik.com Git - wxWidgets.git/commitdiff
suppressed wrong debug error messages from SetFocus
authorVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 Jan 2002 00:42:57 +0000 (00:42 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Thu, 3 Jan 2002 00:42:57 +0000 (00:42 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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
     }
 }