robertjohns 0 Posted November 24, 2023 Hi Is there any way to detect the Windows 11 in Delphi like the way OS := TOSVersion.ToString ; Share this post Link to post
Dave Nottage 557 Posted November 24, 2023 Using TOSVersion: IsWindows11 := (TOSVersion.Major = 10) and (TOSVersion.Minor = 0) and (TOSVersion.Build >= 22000); (At least until Windows 12?) Where IsWindows11 is a Boolean. Share this post Link to post
JonRobertson 72 Posted November 24, 2023 (edited) I don't understand the question. On my Windows 11 laptop, TOSVersion.ToString returns Windows 11 (Version 22H2, OS Build 22621.2715, 64-bit Edition) You could look at TOSVersion.Create in System.SysUtils.pas. TOSVersion.Name should also return "Windows 11" Edited November 24, 2023 by JonRobertson 1 Share this post Link to post
robertjohns 0 Posted November 24, 2023 30 minutes ago, JonRobertson said: I don't understand the question. On my Windows 11 laptop, TOSVersion.ToString returns Windows 11 (Version 22H2, OS Build 22621.2715, 64-bit Edition) You could look at TOSVersion.Create in System.SysUtils.pas. TOSVersion.Name should also return "Windows 11" but on my system TOSVersion.ToString returns Windows 10 Share this post Link to post
Der schöne Günther 316 Posted November 24, 2023 The string "Windows 10" or "Windows 11" does not come from the Windows API, it is a string hardcoded into the Delphi RTL (System.RTLConsts.pas). Delphi 10.2 is from 2017. Windows 11 was released 2021. 1 Share this post Link to post
dummzeuch 1505 Posted November 24, 2023 HKLM\Software\Microsoft\Windows NT\CurrentVersion ProductName: REG_SZ On my Windows 10 pro it says "Windows 10 pro". There are several other entries that might be of interest, e.g. DisplayVersion="22H2". Of course this can easily be manipulated by an administratorl Share this post Link to post