X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/08b97268061292f7c3794dae243a6490b23a42f1..bb7a709657fed261f2a1e60a308bc5548ed892f5:/src/msw/toplevel.cpp diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index e5e40c269c..c1bba3066e 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -312,21 +312,27 @@ WXHWND wxTopLevelWindowMSW::MSWGetParent() const return (WXHWND)hwndParent; } +#if defined(__SMARTPHONE__) || defined(__POCKETPC__) bool wxTopLevelWindowMSW::HandleSettingChange(WXWPARAM wParam, WXLPARAM lParam) { - SHACTIVATEINFO* info = (SHACTIVATEINFO*) m_activateInfo; - if (!info) return false; - return SHHandleWMSettingChange(GetHwnd(), wParam, lParam, info) == TRUE; + SHACTIVATEINFO *info = (SHACTIVATEINFO*) m_activateInfo; + if ( info ) + { + SHHandleWMSettingChange(GetHwnd(), wParam, lParam, info); + } + + return wxWindowMSW::HandleSettingChange(wParam, lParam); } +#endif WXLRESULT wxTopLevelWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) { WXLRESULT rc = 0; bool processed = false; +#if defined(__SMARTPHONE__) || defined(__POCKETPC__) switch ( message ) { -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) case WM_ACTIVATE: { SHACTIVATEINFO* info = (SHACTIVATEINFO*) m_activateInfo; @@ -343,11 +349,6 @@ WXLRESULT wxTopLevelWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WX break; } - case WM_SETTINGCHANGE: - { - processed = HandleSettingChange(wParam,lParam); - break; - } case WM_HIBERNATE: { if (wxTheApp) @@ -358,8 +359,8 @@ WXLRESULT wxTopLevelWindowMSW::MSWWindowProc(WXUINT message, WXWPARAM wParam, WX } break; } -#endif } +#endif if ( !processed ) rc = wxTopLevelWindowBase::MSWWindowProc(message, wParam, lParam); @@ -703,17 +704,21 @@ void wxTopLevelWindowMSW::Maximize(bool maximize) } else // hidden { - // we can't maximize the hidden frame because it shows it as well, so - // just remember that we should do it later in this case + // we can't maximize the hidden frame because it shows it as well, + // so just remember that we should do it later in this case m_maximizeOnShow = maximize; // after calling Maximize() the client code expects to get the frame // "real" size and doesn't want to know that, because of implementation // details, the frame isn't really maximized yet but will be only once // it's shown, so return our size as it will be then in this case - - // we don't know which display we're on yet so use the default one - SetSize(wxGetClientDisplayRect().GetSize()); + if ( maximize ) + { + // unfortunately we don't know which display we're on yet so we + // have to use the default one + SetSize(wxGetClientDisplayRect().GetSize()); + } + //else: can't do anything in this case, we don't have the old size } } @@ -736,10 +741,11 @@ bool wxTopLevelWindowMSW::IsIconized() const #ifdef __WXWINCE__ return false; #else - // also update the current state - ((wxTopLevelWindowMSW *)this)->m_iconized = ::IsIconic(GetHwnd()) != 0; - - return m_iconized; + // don't use m_iconized, it may be briefly out of sync with the real state + // as it's only modified when we receive a WM_SIZE and we could be called + // from an event handler from one of the messages we receive before it, + // such as WM_MOVE + return ::IsIconic(GetHwnd()) != 0; #endif } @@ -882,7 +888,7 @@ void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons) { wxTopLevelWindowBase::SetIcons(icons); -#if defined(__WIN95__) && !defined(__WXMICROWIN__) +#if !defined(__WXMICROWIN__) const wxIcon& sml = icons.GetIcon( wxSize( 16, 16 ) ); if( sml.Ok() && sml.GetWidth() == 16 && sml.GetHeight() == 16 ) { @@ -896,7 +902,7 @@ void wxTopLevelWindowMSW::SetIcons(const wxIconBundle& icons) ::SendMessage( GetHwndOf( this ), WM_SETICON, ICON_BIG, (LPARAM)GetHiconOf(big) ); } -#endif // __WIN95__ +#endif // !__WXMICROWIN__ } bool wxTopLevelWindowMSW::EnableCloseButton(bool enable) @@ -1088,8 +1094,8 @@ void wxTopLevelWindowMSW::OnActivate(wxActivateEvent& event) LONG APIENTRY _EXPORT wxDlgProc(HWND hDlg, UINT message, - WPARAM wParam, - LPARAM lParam) + WPARAM WXUNUSED(wParam), + LPARAM WXUNUSED(lParam)) { switch ( message ) { @@ -1121,14 +1127,6 @@ wxDlgProc(HWND hDlg, // ourselves, we return FALSE for it as well return FALSE; } - -#if defined(__SMARTPHONE__) || defined(__POCKETPC__) - case WM_SETTINGCHANGE: - { - wxTopLevelWindow *tlw = wxDynamicCast(wxGetWindowFromHWND(hDlg), wxTopLevelWindow); - if(tlw) return tlw->HandleSettingChange(wParam,lParam) ? TRUE : FALSE; - } -#endif } // for almost all messages, returning FALSE means that we didn't process