From: Włodzimierz Skiba <abx@abx.art.pl>
Date: Wed, 5 Jan 2005 18:39:48 +0000 (+0000)
Subject: wxMSWUniv wxWindowMSW vs. wxWindow fix.
X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/e32d4b8f07fa4315b7641861c6b740e149b7e6fd

wxMSWUniv wxWindowMSW vs. wxWindow fix.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---

diff --git a/src/msw/window.cpp b/src/msw/window.cpp
index f5e053bc5f..cf15c6ae66 100644
--- a/src/msw/window.cpp
+++ b/src/msw/window.cpp
@@ -1533,7 +1533,14 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
         height = 0;
 
     // if our parent had prepared a defer window handle for us, use it
-    HDWP hdwp = m_parent ? (HDWP)m_parent->m_hDWP : NULL;
+    wxWindowMSW *parent =
+#ifdef __WXUNIVERSAL__
+                          wxDynamicCast(m_parent, wxWindowMSW)
+#else
+                          m_parent
+#endif
+                          ;
+    HDWP hdwp = parent ? (HDWP)parent->m_hDWP : NULL;
     if ( hdwp )
     {
         hdwp = ::DeferWindowPos(hdwp, GetHwnd(), NULL,
@@ -1545,7 +1552,7 @@ void wxWindowMSW::DoMoveWindow(int x, int y, int width, int height)
         }
 
         // hdwp must be updated as it may have been changed
-        m_parent->m_hDWP = (WXHANDLE)hdwp;
+        parent->m_hDWP = (WXHANDLE)hdwp;
     }
 
     // otherwise (or if deferring failed) move the window in place immediately