]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
don't crash when trying to dump struct members which are NULL pointers
[wxWidgets.git] / src / msw / window.cpp
index a2b52faf7a3e58c2a92b571ebfd968a902d46862..a17b0401d29e15b79db3bf669dff18bf5d3f0346 100644 (file)
@@ -1324,18 +1324,27 @@ void wxWindowMSW::Refresh(bool eraseBack, const wxRect *rect)
     HWND hWnd = GetHwnd();
     if ( hWnd )
     {
+        RECT mswRect;
+        const RECT *pRect;
         if ( rect )
         {
-            RECT mswRect;
             mswRect.left = rect->x;
             mswRect.top = rect->y;
             mswRect.right = rect->x + rect->width;
             mswRect.bottom = rect->y + rect->height;
 
-            ::InvalidateRect(hWnd, &mswRect, eraseBack);
+            pRect = &mswRect;
         }
         else
-            ::InvalidateRect(hWnd, NULL, eraseBack);
+        {
+            pRect = NULL;
+        }
+
+        UINT flags = RDW_INVALIDATE | RDW_ALLCHILDREN;
+        if ( eraseBack )
+            flags |= RDW_ERASE;
+
+        ::RedrawWindow(hWnd, pRect, NULL, flags);
     }
 }