X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2e992e06a71d90f1df597441af36f69ef390089a..3f4a2351e4c677c88c18ea812b609477adee7380:/src/msw/window.cpp diff --git a/src/msw/window.cpp b/src/msw/window.cpp index e077df91af..bd7a853adf 100644 --- a/src/msw/window.cpp +++ b/src/msw/window.cpp @@ -3952,13 +3952,12 @@ bool wxWindowMSW::HandlePower(WXWPARAM WXUNUSED_IN_WINCE(wParam), bool wxWindowMSW::IsDoubleBuffered() const { - const wxWindow* wnd = this; - - while ( wnd ) + for ( const wxWindow *wnd = this; + wnd && !wnd->IsTopLevel(); wnd = + wnd->GetParent() ) { - if ( ::GetWindowLong((HWND)wnd->GetHWND(), GWL_EXSTYLE) & WS_EX_COMPOSITED ) + if ( ::GetWindowLong(GetHwndOf(wnd), GWL_EXSTYLE) & WS_EX_COMPOSITED ) return true; - wnd = wnd->GetParent(); } return false;