]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/toplevel.cpp
fixed CURSOR resource leak
[wxWidgets.git] / src / msw / toplevel.cpp
index 0720766612eb0417614886e0784f9396c58661bf..96cdd426005bb53c51a923de49a6131f4cbdbcb9 100644 (file)
@@ -192,6 +192,13 @@ bool wxTopLevelWindowMSW::CreateDialog(const wxChar *dlgTemplate,
     if ( !parent && !(GetWindowStyleFlag() & wxDIALOG_NO_PARENT) )
     {
         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() )
+        {
+            parent = NULL;
+        }
     }
 
     m_hWnd = (WXHWND)::CreateDialog(wxGetInstance(),
@@ -258,6 +265,13 @@ bool wxTopLevelWindowMSW::CreateDialog(const wxChar *dlgTemplate,
             h = 100;
         }
 
+        if ( x == CW_USEDEFAULT )
+        {
+            // well, where should we put it? maybe centre it on screen?
+            x =
+            y = 0;
+        }
+
         if ( !::MoveWindow(GetHwnd(), x, y, w, h, FALSE) )
         {
             wxLogLastError(wxT("MoveWindow"));