X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7f6cf37004ce42bba674e577b8a39b853aa08254..328a3a009fd86bb7df6efc4e0086074af34846ab:/src/msw/toplevel.cpp diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 315d02dea9..0d1a0735cd 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -473,7 +473,7 @@ bool wxTopLevelWindowMSW::CreateDialog(const void *dlgTemplate, if ( !title.empty() ) { - ::SetWindowText(GetHwnd(), title.wx_str()); + ::SetWindowText(GetHwnd(), title.t_str()); } SubclassWin(m_hWnd); @@ -523,7 +523,7 @@ bool wxTopLevelWindowMSW::CreateFrame(const wxString& title, #endif return MSWCreate(MSWGetRegisteredClassName(), - title.wx_str(), pos, sz, flags, exflags); + title.t_str(), pos, sz, flags, exflags); } bool wxTopLevelWindowMSW::Create(wxWindow *parent, @@ -709,9 +709,21 @@ bool wxTopLevelWindowMSW::Show(bool show) } else if ( m_iconized ) { - // iconize and show + // We were iconized while we were hidden, so now we need to show + // the window in iconized state. nShowCmd = SW_MINIMIZE; } + else if ( ::IsIconic(GetHwnd()) ) + { + // We were restored while we were hidden, so now we need to show + // the window in its normal state. + // + // As below, don't activate some kinds of windows. + if ( HasFlag(wxFRAME_TOOL_WINDOW) || !IsEnabled() ) + nShowCmd = SW_SHOWNOACTIVATE; + else + nShowCmd = SW_RESTORE; + } else // just show { // we shouldn't use SW_SHOW which also activates the window for @@ -823,9 +835,9 @@ void wxTopLevelWindowMSW::Iconize(bool iconize) } else // hidden { - // iconizing the window shouldn't show it so just remember that we need - // to become iconized when shown later - m_iconized = true; + // iconizing the window shouldn't show it so just update the internal + // state (otherwise it's done by DoShowWindow() itself) + m_iconized = iconize; } }