]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/control.cpp
Forward port 2.8 fix.
[wxWidgets.git] / src / msw / control.cpp
index c573e4a29a4f497e770a5a3a1e7aa5dcab2dccfa..1cc9dce77e25cf1e66285c1b3372e0cc582b0612 100644 (file)
@@ -367,7 +367,8 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd)
     WXHBRUSH hbr = 0;
     if ( !colBg.Ok() )
     {
-        hbr = MSWGetBgBrush(pDC, hWnd);
+        if ( wxWindow *win = wxFindWinFromHandle(hWnd) )
+            hbr = MSWGetBgBrush(pDC, win);
 
         // if the control doesn't have any bg colour, foreground colour will be
         // ignored as the return value would be 0 -- so forcefully give it a