+void wxDialog::ResizeGripper()
+{
+ wxASSERT_MSG( m_hGripper, wxT("shouldn't be called if we have no gripper") );
+
+ HWND hwndGripper = (HWND)m_hGripper;
+
+ const wxRect rectGripper = wxRectFromRECT(wxGetWindowRect(hwndGripper));
+ const wxSize size = GetClientSize() - rectGripper.GetSize();
+
+ ::SetWindowPos(hwndGripper, HWND_BOTTOM,
+ size.x, size.y,
+ rectGripper.width, rectGripper.height,
+ SWP_NOACTIVATE);
+}
+
+void wxDialog::OnWindowCreate(wxWindowCreateEvent& event)
+{
+ if ( m_hGripper && IsShown() &&
+ event.GetWindow() && event.GetWindow()->GetParent() == this )
+ {
+ // Put gripper below the newly created child window
+ ::SetWindowPos((HWND)m_hGripper, HWND_BOTTOM, 0, 0, 0, 0,
+ SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
+ }
+
+ event.Skip();
+}
+
+#endif // wxUSE_DIALOG_SIZEGRIP
+