From d2d7a07b7abeec6946631fb94c40c940fdb3d952 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 22 May 2014 20:35:50 +0000 Subject: [PATCH] Return wxWinVersion_[78] correctly from wxMSW wxGetWinVersion(). This is especially important because the workaround of r76152 for IFileDialog bug under Windows Vista also applied under later Windows versions as they were not detected correctly. Closes #16286. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76600 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/msw/private.h | 5 ++++- src/msw/utils.cpp | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/include/wx/msw/private.h b/include/wx/msw/private.h index eefc504485..ecfe7a6960 100644 --- a/include/wx/msw/private.h +++ b/include/wx/msw/private.h @@ -897,6 +897,7 @@ inline wxString wxGetFullModuleName() // 0x0502 Windows XP SP2, 2003 SP1 // 0x0600 Windows Vista, 2008 // 0x0601 Windows 7 +// 0x0602 Windows 8 (currently also returned for 8.1) // // for the other Windows versions 0 is currently returned enum wxWinVersion @@ -924,7 +925,9 @@ enum wxWinVersion wxWinVersion_Vista = wxWinVersion_6, wxWinVersion_NT6 = wxWinVersion_6, - wxWinVersion_7 = 0x601 + wxWinVersion_7 = 0x601, + + wxWinVersion_8 = 0x602 }; WXDLLIMPEXP_BASE wxWinVersion wxGetWinVersion(); diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index d3f9aa7db1..71f8cae2a4 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1351,10 +1351,19 @@ wxWinVersion wxGetWinVersion() break; case 6: - return wxWinVersion_NT6; - } - break; + switch ( verMin ) + { + case 0: + return wxWinVersion_Vista; + case 1: + return wxWinVersion_7; + + case 2: + return wxWinVersion_8; + } + break; + } default: // Do nothing just to silence GCC warning break;