X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0534259ab803b0edd8692e966947b202cd9e10c0..ca1f7cb56322e35a5bf3d9612cd14c128246947c:/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