]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toplevel.cpp
DOS compilation fixes
[wxWidgets.git] / src / msw / toplevel.cpp
index 6df54650629d8efcfd7935737cd3c45fda001a25..a7b917f9f112a95a58380147ff72a91930bb289f 100644 (file)
@@ -45,7 +45,7 @@
 
 #ifdef __WXMICROWIN__
 
-static inline bool IsIconic(HWND WXUNUSED(hwnd)) { return FALSE; }
+// static inline bool IsIconic(HWND WXUNUSED(hwnd)) { return FALSE; }
 static inline bool IsZoomed(HWND WXUNUSED(hwnd)) { return FALSE; }
 
 #endif // __WXMICROWIN__
@@ -196,11 +196,18 @@ bool wxTopLevelWindowMSW::CreateDialog(const wxChar *dlgTemplate,
     {
         parent = wxTheApp->GetTopWindow();
 
-        // but don't use the window which is currently hidden as then the
-        // dialog would be hidden as well
-        if ( parent && !parent->IsShown() )
+        if ( parent )
         {
-            parent = NULL;
+            // don't use transient windows as parents, this is dangerous as it
+            // can lead to a crash if the parent is destroyed before the child
+            //
+            // also don't use the window which is currently hidden as then the
+            // dialog would be hidden as well
+            if ( (parent->GetExtraStyle() & wxWS_EX_TRANSIENT) ||
+                    !parent->IsShown() )
+            {
+                parent = NULL;
+            }
         }
     }