-void wxNotebook::DoEraseBackground(wxWindow *win, WXHDC hDC)
-{
- // we can either draw the background ourselves or let DrawThemeBackground()
- // do it, but as we already have the correct brush, let's do it ourselves
- // (note that we use the same code in wxControl::MSWControlColor(), so if
- // it breaks, it should at least break in consistent way)
- WXHBRUSH hbr = GetThemeBackgroundBrush(hDC, win);
- if ( hbr )
- {
- RECT rectClient;
- ::GetClientRect(GetHwndOf(win), &rectClient);
- ::FillRect((HDC)hDC, &rectClient, (HBRUSH)hbr);
- }
+ if ( !wxUxThemeEngine::GetIfActive() )
+ return wxNullColour;
+
+ COLORREF c = (COLORREF)QueryBgBitmap(win);
+
+ return c == CLR_INVALID ? wxNullColour : wxRGBToColour(c);