X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0534259ab803b0edd8692e966947b202cd9e10c0..a78d2fbab115b4c6537349fb06275d1610bf4aa0:/src/msw/control.cpp?ds=sidebyside diff --git a/src/msw/control.cpp b/src/msw/control.cpp index c573e4a29a..056794b517 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 = win->MSWGetBgBrush(pDC); // 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