From 9a4aa20bbb452ef26f892c6370580283be60271c Mon Sep 17 00:00:00 2001 From: Wojciech Figat Date: Wed, 9 Feb 2022 09:23:44 +0100 Subject: [PATCH] Add Windows 11 detection --- Source/Engine/Platform/Windows/WindowsPlatform.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Platform/Windows/WindowsPlatform.cpp b/Source/Engine/Platform/Windows/WindowsPlatform.cpp index 075bf7f90..8ef586722 100644 --- a/Source/Engine/Platform/Windows/WindowsPlatform.cpp +++ b/Source/Engine/Platform/Windows/WindowsPlatform.cpp @@ -177,8 +177,12 @@ void GetWindowsVersion(String& windowsName, int32& versionMajor, int32& versionM VersionMajor = 6; VersionMinor = 2; } - - if (VersionMajor == 0 && VersionMinor == 0) + else if (VersionMajor >= 10 && VersionBuild >= 22000) + { + // Windows 11 + windowsName.Replace(TEXT("10"), TEXT("11")); + } + else if (VersionMajor == 0 && VersionMinor == 0) { String windowsVersion; GetStringRegKey(hKey, TEXT("CurrentVersion"), windowsVersion, TEXT(""));