X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0534259ab803b0edd8692e966947b202cd9e10c0..867518a5badd321ac3b9cb0b46eca3276ff875fc:/src/msw/control.cpp?ds=sidebyside diff --git a/src/msw/control.cpp b/src/msw/control.cpp index c573e4a29a..1cc9dce77e 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -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