1. wxWindowDisabler modified to bring parent window back to top under MSW
2. modal dialogs without parent now use the app top window as parent or use wxWindowDisabler if none 3. modal dialogs bring parent windows to top when activated 4. wxBase dsp will now compile it with MT CRT git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6451 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -78,7 +78,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef __WXMSW__
|
||||
#include "windows.h"
|
||||
#include "wx/msw/private.h"
|
||||
#endif
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -983,6 +983,12 @@ wxWindowDisabler::wxWindowDisabler(wxWindow *winToSkip)
|
||||
// remember all windows we're going to (temporarily) disable
|
||||
m_winDisabled = new wxWindowList;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
// and the top level window too
|
||||
HWND hwndFG = ::GetForegroundWindow();
|
||||
m_winTop = hwndFG ? wxFindWinFromHandle((WXHWND)hwndFG) : (wxWindow *)NULL;
|
||||
#endif // MSW
|
||||
|
||||
wxWindowList::Node *node;
|
||||
for ( node = wxTopLevelWindows.GetFirst(); node; node = node->GetNext() )
|
||||
{
|
||||
@@ -1013,6 +1019,16 @@ wxWindowDisabler::~wxWindowDisabler()
|
||||
}
|
||||
|
||||
delete m_winDisabled;
|
||||
|
||||
#ifdef __WXMSW__
|
||||
if ( m_winTop )
|
||||
{
|
||||
if ( !::SetForegroundWindow(GetHwndOf(m_winTop)) )
|
||||
{
|
||||
wxLogLastError("SetForegroundWindow");
|
||||
}
|
||||
}
|
||||
#endif // MSW
|
||||
}
|
||||
|
||||
// Yield to other apps/messages and disable user input to all windows except
|
||||
@@ -1188,7 +1204,7 @@ long wxExecute(const wxString& command, wxArrayString& output)
|
||||
{
|
||||
wxInputStream& is = *process->GetInputStream();
|
||||
wxTextInputStream tis(is);
|
||||
while ( !is.Eof() )
|
||||
while ( !is.Eof() && is.IsOk() )
|
||||
{
|
||||
wxString line = tis.ReadLine();
|
||||
if ( is.LastError() )
|
||||
|
Reference in New Issue
Block a user