+UINT_PTR APIENTRY
+wxFileDialogHookFunction(HWND hDlg,
+ UINT iMsg,
+ WPARAM WXUNUSED(wParam),
+ LPARAM lParam)
+{
+ switch ( iMsg )
+ {
+ case WM_NOTIFY:
+ {
+ OFNOTIFY *pNotifyCode = wx_reinterpret_cast(OFNOTIFY *, lParam);
+ if ( pNotifyCode->hdr.code == CDN_INITDONE )
+ {
+ // note that we need to move the parent window: hDlg is a
+ // child of it when OFN_EXPLORER is used
+ ::SetWindowPos
+ (
+ ::GetParent(hDlg),
+ HWND_TOP,
+ gs_rectDialog.x, gs_rectDialog.y,
+ 0, 0,
+ SWP_NOZORDER | SWP_NOSIZE
+ );
+ }
+ }
+ break;
+
+ case WM_DESTROY:
+ // reuse the position used for the dialog the next time by default
+ //
+ // NB: at least under Windows 2003 this is useless as after the
+ // first time it's shown the dialog always remembers its size
+ // and position itself and ignores any later SetWindowPos calls
+ wxCopyRECTToRect(wxGetWindowRect(::GetParent(hDlg)), gs_rectDialog);
+ break;
+ }
+
+ // do the default processing
+ return 0;
+}
+
+// ----------------------------------------------------------------------------
+// wxFileDialog
+// ----------------------------------------------------------------------------
+
+wxFileDialog::wxFileDialog(wxWindow *parent,
+ const wxString& message,
+ const wxString& defaultDir,
+ const wxString& defaultFileName,
+ const wxString& wildCard,
+ long style,
+ const wxPoint& pos,
+ const wxSize& sz,
+ const wxString& name)
+ : wxFileDialogBase(parent, message, defaultDir, defaultFileName,
+ wildCard, style, pos, sz, name)