- if ( filterBuffer ) { // Substituting '|' with '\0'
- for ( int i = 0; i < filterBufferLen; i++ ) {
- if ( filterBuffer[i] == '|' ) { filterBuffer[i] = '\0'; }
- }
+ return true;
+}
+
+#ifndef __WXWINCE__
+void wxFileDialog::MSWOnInitDialogHook(WXHWND hwnd)
+{
+ SetHWND(hwnd);
+
+ CreateExtraControl();
+
+ SetHWND(NULL);
+}
+#endif // __WXWINCE__
+
+int wxFileDialog::ShowModal()
+{
+ WX_HOOK_MODAL_DIALOG();
+
+ HWND hWnd = 0;
+ if (m_parent) hWnd = (HWND) m_parent->GetHWND();
+ if (!hWnd && wxTheApp->GetTopWindow())
+ hWnd = (HWND) wxTheApp->GetTopWindow()->GetHWND();
+
+ static wxChar fileNameBuffer [ wxMAXPATH ]; // the file-name
+ wxChar titleBuffer [ wxMAXFILE+1+wxMAXEXT ]; // the file-name, without path
+
+ *fileNameBuffer = wxT('\0');
+ *titleBuffer = wxT('\0');
+
+ long msw_flags = OFN_HIDEREADONLY;
+
+ if ( HasFdFlag(wxFD_FILE_MUST_EXIST) )
+ msw_flags |= OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;
+ /*
+ If the window has been moved the programmer is probably
+ trying to center or position it. Thus we set the callback
+ or hook function so that we can actually adjust the position.
+ Without moving or centering the dlg, it will just stay
+ in the upper left of the frame, it does not center
+ automatically.
+ */
+ if (m_bMovedWindow || HasExtraControlCreator()) // we need these flags.
+ {
+ ChangeExceptionPolicy();
+ msw_flags |= OFN_EXPLORER|OFN_ENABLEHOOK;
+#ifndef __WXWINCE__
+ msw_flags |= OFN_ENABLESIZING;
+#endif