summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp28
-rw-r--r--src/gui/dialogs/qfiledialog_win_p.h49
-rw-r--r--src/gui/util/qsystemtrayicon_win.cpp1
3 files changed, 47 insertions, 31 deletions
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index 4e333f2..f8c3b84 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -60,21 +60,6 @@
#ifdef Q_WS_WINCE
#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"
@@ -457,7 +442,7 @@ static bool qt_win_set_IFileDialogOptions(IFileDialog *pfd,
// Add the filters to the file dialog.
if (numFilters) {
wchar_t *szData = (wchar_t*)winfilters.utf16();
- COMDLG_FILTERSPEC *filterSpec = new COMDLG_FILTERSPEC[numFilters];
+ qt_COMDLG_FILTERSPEC *filterSpec = new qt_COMDLG_FILTERSPEC[numFilters];
for(int i = 0; i<numFilters; i++) {
filterSpec[i].pszName = szData+offsets[i*2];
filterSpec[i].pszSpec = szData+offsets[(i*2)+1];
@@ -713,11 +698,6 @@ 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();
@@ -742,11 +722,7 @@ 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);
@@ -760,7 +736,7 @@ QString qt_win_get_existing_directory(const QFileDialogArgs &args)
qt_win_resolve_libs();
if (ptrSHBrowseForFolder) {
- LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder((BROWSEINFO*)&bi);
+ LPITEMIDLIST pItemIDList = ptrSHBrowseForFolder(&bi);
if (pItemIDList) {
ptrSHGetPathFromIDList(pItemIDList, path);
IMalloc *pMalloc;
diff --git a/src/gui/dialogs/qfiledialog_win_p.h b/src/gui/dialogs/qfiledialog_win_p.h
index 6d8c7c9..b55d1ff 100644
--- a/src/gui/dialogs/qfiledialog_win_p.h
+++ b/src/gui/dialogs/qfiledialog_win_p.h
@@ -39,9 +39,9 @@
**
****************************************************************************/
-#include <shlobj.h>
+#include <shtypes.h>
#include <objbase.h>
-#if !defined(QFILEDIAG_WIN_P_H) && !defined(__shobjidl_h__)
+#ifndef QFILEDIAG_WIN_P_H
//these are the interface declarations needed for the file dialog on Vista and up
@@ -50,6 +50,8 @@
//declarations
typedef DWORD SICHINTF;
+typedef ULONG SFGAOF;
+typedef DWORD SHCONTF;
#define FOS_OVERWRITEPROMPT 0x2
#define FOS_STRICTFILETYPES 0x4
#define FOS_NOCHANGEDIR 0x8
@@ -83,6 +85,31 @@ typedef int GETPROPERTYSTOREFLAGS;
#define GPS_BESTEFFORT 0x00000040
#define GPS_MASK_VALID 0x0000007F
+typedef int (CALLBACK* BFFCALLBACK)(HWND hwnd, UINT uMsg, LPARAM lParam, LPARAM lpData);
+// message from browser
+#define BFFM_INITIALIZED 1
+#define BFFM_SELCHANGED 2
+#define BFFM_ENABLEOK (WM_USER + 101)
+#define BFFM_SETSELECTION (WM_USER + 103)
+#define BFFM_SETSTATUSTEXT (WM_USER + 104)
+
+// Browsing for directory.
+#define BIF_RETURNONLYFSDIRS 0x0001
+#define BIF_DONTGOBELOWDOMAIN 0x0002
+#define BIF_STATUSTEXT 0x0004
+#define BIF_RETURNFSANCESTORS 0x0008
+#define BIF_EDITBOX 0x0010
+#define BIF_VALIDATE 0x0020
+#define BIF_NEWDIALOGSTYLE 0x0040
+#define BIF_BROWSEINCLUDEURLS 0x0080
+#define BIF_UAHINT 0x0100
+#define BIF_NONEWFOLDERBUTTON 0x0200
+#define BIF_NOTRANSLATETARGETS 0x0400
+#define BIF_BROWSEFORCOMPUTER 0x1000
+#define BIF_BROWSEFORPRINTER 0x2000
+#define BIF_BROWSEINCLUDEFILES 0x4000
+#define BIF_SHAREABLE 0x8000
+
//the enums
typedef enum {
SIATTRIBFLAGS_AND = 0x1,
@@ -115,11 +142,25 @@ typedef FDE_SHAREVIOLATION_RESPONSE FDE_OVERWRITE_RESPONSE;
typedef struct {
LPCWSTR pszName;
LPCWSTR pszSpec;
-} COMDLG_FILTERSPEC;
+} qt_COMDLG_FILTERSPEC;
+#ifndef PROPERTYKEY_DEFINED
+#define PROPERTYKEY_DEFINED
typedef struct {
GUID fmtid;
DWORD pid;
} PROPERTYKEY;
+#endif
+typedef struct {
+ HWND hwndOwner;
+ LPCITEMIDLIST pidlRoot;
+ LPWSTR pszDisplayName;
+ LPCWSTR lpszTitle;
+ UINT ulFlags;
+ BFFCALLBACK lpfn;
+ LPARAM lParam;
+ int iImage;
+} BROWSEINFO;
+
DECLARE_INTERFACE(IFileDialogEvents);
DECLARE_INTERFACE_(IShellItem, IUnknown)
{
@@ -157,7 +198,7 @@ DECLARE_INTERFACE_(IModalWindow, IUnknown)
};
DECLARE_INTERFACE_(IFileDialog, IModalWindow)
{
- STDMETHOD(SetFileTypes)(THIS_ UINT cFileTypes, const COMDLG_FILTERSPEC *rgFilterSpec) PURE;
+ STDMETHOD(SetFileTypes)(THIS_ UINT cFileTypes, const qt_COMDLG_FILTERSPEC *rgFilterSpec) PURE;
STDMETHOD(SetFileTypeIndex)(THIS_ UINT iFileType) PURE;
STDMETHOD(GetFileTypeIndex)(THIS_ UINT *piFileType) PURE;
STDMETHOD(Advise)(THIS_ IFileDialogEvents *pfde, DWORD *pdwCookie) PURE;
diff --git a/src/gui/util/qsystemtrayicon_win.cpp b/src/gui/util/qsystemtrayicon_win.cpp
index 6db158e..092909f 100644
--- a/src/gui/util/qsystemtrayicon_win.cpp
+++ b/src/gui/util/qsystemtrayicon_win.cpp
@@ -53,7 +53,6 @@
#include <qt_windows.h>
#include <commctrl.h>
-#include <shlwapi.h>
#include <QBitmap>
#include <QLibrary>
#include <QApplication>