summaryrefslogtreecommitdiffstats
path: root/src/gui/dialogs
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/dialogs')
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index f8c3b84..7938040 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -59,7 +59,23 @@
#endif
#ifdef Q_WS_WINCE
+#include <shlobj.h>
#include <commdlg.h>
+# ifndef BFFM_SETSELECTION
+# define BFFM_SETSELECTION (WM_USER + 102)
+# endif
+// Windows Mobile has a broken definition for BROWSEINFO
+// Only compile fix
+typedef struct qt_priv_browseinfo {
+ HWND hwndOwner;
+ LPCITEMIDLIST pidlRoot;
+ LPWSTR pszDisplayName;
+ LPCWSTR lpszTitle;
+ UINT ulFlags;
+ BFFCALLBACK lpfn;
+ LPARAM lParam;
+ int iImage;
+} qt_BROWSEINFO;
bool qt_priv_ptr_valid = false;
#else
#include "qfiledialog_win_p.h"
@@ -698,6 +714,11 @@ static int __stdcall winGetExistDirCallbackProc(HWND hwnd,
return 0;
}
+#ifndef BIF_NEWDIALOGSTYLE
+#define BIF_NEWDIALOGSTYLE 0x0040 // Use the new dialog layout with the ability to resize
+#endif
+
+
QString qt_win_get_existing_directory(const QFileDialogArgs &args)
{
QString currentDir = QDir::currentPath();
@@ -722,7 +743,11 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args)
path[0] = 0;
tTitle = args.caption;
+#if !defined(Q_WS_WINCE)
BROWSEINFO bi;
+#else
+ qt_BROWSEINFO bi;
+#endif
Q_ASSERT(!parent ||parent->testAttribute(Qt::WA_WState_Created));
bi.hwndOwner = (parent ? parent->winId() : 0);
@@ -736,7 +761,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args)
qt_win_resolve_libs();
if (ptrSHBrowseForFolder) {
- LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi);
+ LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder((BROWSEINFO*)&bi);
if (pItemIDList) {
ptrSHGetPathFromIDList(pItemIDList, path);
IMalloc *pMalloc;