]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/window.cpp
Back to previous call with -1 replacement.
[wxWidgets.git] / src / msw / window.cpp
index e077df91af47b24c86cb1486e584194f4cfe3d47..bd7a853adf3b93f78087cf87a641d6323c8aa3e2 100644 (file)
@@ -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;