From 7c7eed5656421bac6bfd56c13bef786fde9407ca Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 16 May 2011 10:01:08 +0000 Subject: [PATCH 1/1] Recognize Windows 7 and Server 2008 versions in wxGetOsDescription(). Use marketing names for these systems instead of just describing them as "Window NT x.y". Closes #13220. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/utils.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/src/msw/utils.cpp b/src/msw/utils.cpp index a002517d25..d371459b09 100644 --- a/src/msw/utils.cpp +++ b/src/msw/utils.cpp @@ -1298,10 +1298,33 @@ wxString wxGetOsDescription() break; case 6: - if ( info.dwMinorVersion == 0 ) + switch ( info.dwMinorVersion ) { - str.Printf(_("Windows Vista (build %lu"), - info.dwBuildNumber); + case 0: + if ( wxIsWindowsServer() == 1 ) + { + str.Printf(_("Windows Server 2008 (build %lu"), + info.dwBuildNumber); + } + else + { + str.Printf(_("Windows Vista (build %lu"), + info.dwBuildNumber); + } + break; + + case 1: + if ( wxIsWindowsServer() == 1 ) + { + str.Printf(_("Windows Server 2008 R2 (build %lu"), + info.dwBuildNumber); + } + else + { + str.Printf(_("Windows 7 (build %lu"), + info.dwBuildNumber); + } + break; } break; } -- 2.45.2