X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/cde9f08e1f2bba81294708c1d65bb869ed744e56..eeccd5d94ce6b11f36af95db4ac528a2e2e0c4c5:/src/msw/dialog.cpp diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index af8ad17747..d5f08d2412 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -361,6 +361,10 @@ bool wxDialog::Show(bool show) TranslateMessage(&msg); DispatchMessage(&msg); } + + // If we get crashes (as per George Tasker's message) with nested modal dialogs, + // we should try removing the m_modalShowing test + if (m_modalShowing && !::PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE)) // dfgg: NB MUST test m_modalShowing again as the message loop could have triggered // a Show(FALSE) in the mean time!!! @@ -376,9 +380,12 @@ bool wxDialog::Show(bool show) node=disabledWindows.First(); while(node) { wxWindow* win = (wxWindow*) node->Data(); - HWND hWnd = (HWND) win->GetHWND(); - if (::IsWindow(hWnd) && (wxModalDialogs.Member(win) || wxModelessWindows.Member(win) )) - ::EnableWindow(hWnd,TRUE); + if (wxModalDialogs.Member(win) || wxModelessWindows.Member(win)) + { + HWND hWnd = (HWND) win->GetHWND(); + if (::IsWindow(hWnd)) + ::EnableWindow(hWnd,TRUE); + } node=node->Next(); } }