+ // update this window size
+ bool processed = false;
+ switch ( wParam )
+ {
+ default:
+ wxFAIL_MSG( _T("unexpected WM_SIZE parameter") );
+ // fall through nevertheless
+
+ case SIZE_MAXHIDE:
+ case SIZE_MAXSHOW:
+ // we're not interested in these messages at all
+ break;
+
+ case SIZE_MINIMIZED:
+ processed = HandleMinimize();
+ break;
+
+ case SIZE_MAXIMIZED:
+ /* processed = */ HandleMaximize();
+ // fall through to send a normal size event as well
+
+ case SIZE_RESTORED:
+ // don't use w and h parameters as they specify the client size
+ // while according to the docs EVT_SIZE handler is supposed to
+ // receive the total size
+ wxSizeEvent event(GetSize(), m_windowId);
+ event.SetEventObject(this);
+
+ processed = GetEventHandler()->ProcessEvent(event);
+ }
+
+ // and finally change the positions of all child windows at once
+ if ( m_hDWP )
+ {
+ // reset m_hDWP to NULL so that child windows don't try to use our
+ // m_hDWP after we call EndDeferWindowPos() on it (this shouldn't
+ // happen anyhow normally but who knows what weird flow of control we
+ // may have depending on what the users EVT_SIZE handler does...)
+ HDWP hDWP = (HDWP)m_hDWP;
+ m_hDWP = NULL;
+
+ // do put all child controls in place at once
+ if ( !::EndDeferWindowPos(hDWP) )
+ {
+ wxLogLastError(_T("EndDeferWindowPos"));
+ }
+ }
+
+ return processed;