+// ----------------------------------------------------------------------------
+// hook function for moving the dialog
+// ----------------------------------------------------------------------------
+
+UINT APIENTRY
+wxFileDialogHookFunction(HWND hDlg,
+ UINT iMsg,
+ WPARAM WXUNUSED(wParam),
+ LPARAM lParam)
+{
+ HWND hwndDialog;
+ hwndDialog = ::GetParent( hDlg );
+ switch (iMsg)
+ {
+ case WM_DESTROY:
+ {
+ RECT dlgRect;
+ GetWindowRect( hwndDialog, & dlgRect );
+ gs_rectDialog.x = dlgRect.left;
+ gs_rectDialog.y = dlgRect.top;
+ gs_rectDialog.width = dlgRect.right - dlgRect.left;
+ gs_rectDialog.height = dlgRect.bottom - dlgRect.top;
+ }
+ break;
+
+ case WM_NOTIFY:
+ {
+ OFNOTIFY * pNotifyCode;
+ pNotifyCode = (LPOFNOTIFY) lParam;
+ if (CDN_INITDONE == (pNotifyCode->hdr).code)
+ {
+ SetWindowPos( hwndDialog, HWND_TOP,
+ gs_rectDialog.x,
+ gs_rectDialog.y,
+ gs_rectDialog.width,
+ gs_rectDialog.height,
+ SWP_NOZORDER|SWP_NOSIZE);
+ }
+ }
+ break;
+ }
+
+ // do the default processing
+ return 0;
+}
+