diff options
author | Kevin Barnes <krbarnes> | 2007-05-18 18:25:57 +0000 |
---|---|---|
committer | Kevin Barnes <krbarnes> | 2007-05-18 18:25:57 +0000 |
commit | 0e44312d8bacf7415657253a36f4b5c4ce37fd23 (patch) | |
tree | 1be01d630d0464f47dd5f38a0a4095df8c5320b2 | |
parent | b0ce542f60cb1fa151f351ae95b6b82622586687 (diff) | |
download | eclipse.platform.swt-0e44312d8bacf7415657253a36f4b5c4ce37fd23.tar.gz eclipse.platform.swt-0e44312d8bacf7415657253a36f4b5c4ce37fd23.tar.xz eclipse.platform.swt-0e44312d8bacf7415657253a36f4b5c4ce37fd23.zip |
187878 - FileDialog with MULTI has old look
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java | 1 | ||||
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java | 14 |
2 files changed, 11 insertions, 4 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java index 71a5b2749a..41b693c07d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/org/eclipse/swt/internal/win32/OS.java @@ -632,6 +632,7 @@ public class OS extends C { public static final int FEATURE_DISABLE_NAVIGATION_SOUNDS = 21; public static final int FILE_ATTRIBUTE_NORMAL = 0x00000080; public static final int FNERR_INVALIDFILENAME = 0x3002; + public static final int FNERR_BUFFERTOOSMALL = 0x3003; public static final int FORMAT_MESSAGE_ALLOCATE_BUFFER = 0x00000100; public static final int FORMAT_MESSAGE_FROM_SYSTEM = 0x00001000; public static final int FORMAT_MESSAGE_IGNORE_INSERTS = 0x00000200; diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java index 8532eb740b..ddffc2018e 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/FileDialog.java @@ -38,6 +38,7 @@ public class FileDialog extends Dialog { String filterPath = "", fileName = ""; static final String FILTER = "*.*"; static int BUFFER_SIZE = 1024 * 32; + static boolean USE_HOOK; /** * Constructs a new instance of this class given only its parent. @@ -247,7 +248,7 @@ public String open () { Callback callback = null; if ((style & SWT.MULTI) != 0) { struct.Flags |= OS.OFN_ALLOWMULTISELECT | OS.OFN_EXPLORER; - if (!OS.IsWinCE) { + if (!OS.IsWinCE && USE_HOOK) { callback = new Callback (this, "OFNHookProc", 4); //$NON-NLS-1$ int lpfnHook = callback.getAddress (); if (lpfnHook == 0) SWT.error (SWT.ERROR_NO_MORE_CALLBACKS); @@ -303,9 +304,14 @@ public String open () { * file name, use an empty file name and open it again. */ boolean success = (save) ? OS.GetSaveFileName (struct) : OS.GetOpenFileName (struct); - if (OS.CommDlgExtendedError () == OS.FNERR_INVALIDFILENAME) { - OS.MoveMemory (lpstrFile, new TCHAR (0, "", true), TCHAR.sizeof); - success = (save) ? OS.GetSaveFileName (struct) : OS.GetOpenFileName (struct); + switch (OS.CommDlgExtendedError ()) { + case OS.FNERR_INVALIDFILENAME: + OS.MoveMemory (lpstrFile, new TCHAR (0, "", true), TCHAR.sizeof); + success = (save) ? OS.GetSaveFileName (struct) : OS.GetOpenFileName (struct); + break; + case OS.FNERR_BUFFERTOOSMALL: + USE_HOOK = true; + break; } display.runMessagesInIdle = oldRunMessagesInIdle; |