+ case WM_WINDOWPOSCHANGING:
+ {
+ // when we resize this window, its children are probably going
+ // to be repositioned as well, prepare to use DeferWindowPos()
+ // for them
+ const int numChildren = GetChildren().GetCount();
+ if ( numChildren > 1 )
+ {
+ m_hDWP = (WXHANDLE)::BeginDeferWindowPos(numChildren);
+ if ( !m_hDWP )
+ {
+ wxLogLastError(_T("BeginDeferWindowPos"));
+ }
+ }
+ }
+ break;
+
+ case WM_SIZE:
+ processed = HandleSize(LOWORD(lParam), HIWORD(lParam), wParam);
+
+ if ( m_hDWP )
+ {
+ // put all child controls in place at once now
+ if ( !::EndDeferWindowPos((HDWP)m_hDWP) )
+ {
+ wxLogLastError(_T("EndDeferWindowPos"));
+ }
+
+ m_hDWP = NULL;
+ }
+ break;
+