From a489001977bbb158a434a83c625eaeba7ffbaf7d Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 16 Mar 2014 13:05:47 +0000 Subject: [PATCH] Disable the use of new style wxDirDialog under Vista. IFileDialog-based dialog has a bug making it return a wrong path sometimes under Vista, disable its use there to avoid it. Closes #16005. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76152 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/dirdlg.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/msw/dirdlg.cpp b/src/msw/dirdlg.cpp index cec2c85b7a..549adec9ba 100644 --- a/src/msw/dirdlg.cpp +++ b/src/msw/dirdlg.cpp @@ -228,7 +228,12 @@ int wxDirDialog::ShowModal() // Use IFileDialog under new enough Windows, it's more user-friendly. int rc; #if wxUSE_IFILEDIALOG - if ( wxGetWinVersion() >= wxWinVersion_Vista ) + // While the new dialog is available under Vista, it may return a wrong + // path there (see http://support.microsoft.com/kb/969885/en-us), so we + // don't use it there by default. We could improve the version test to + // allow its use if the comdlg32.dll version is greater than 6.0.6002.22125 + // as this means that the hotfix correcting this bug is installed. + if ( wxGetWinVersion() > wxWinVersion_Vista ) { rc = ShowIFileDialog(hWndParent); }