+#ifndef __SMARTPHONE__ // or wxWinCE in general ?
+ case WM_WINDOWPOSCHANGING:
+ {
+ WINDOWPOS *wp = wx_reinterpret_cast(WINDOWPOS *, lParam);
+
+ if ( wp->flags & SWP_NOSIZE )
+ break;
+
+ // 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_WINDOWPOSCHANGED:
+ // first let DefWindowProc() handle the message: it will generate
+ // WM_MOVE and WM_SIZE as needed
+ processed = MSWDefWindowProc(message, wParam, lParam) == 0;
+
+ // then change the positions of all child windows at once
+ if ( m_hDWP )
+ {
+ HDWP hDWP = (HDWP)m_hDWP;
+ m_hDWP = NULL;
+
+ // put all child controls in place at once now
+ if ( !::EndDeferWindowPos(hDWP) )
+ {
+ wxLogLastError(_T("EndDeferWindowPos"));
+ }
+ }
+ break;
+#endif // __SMARTPHONE__
+