spiegel-keyman/common/windows/delphi/general/GetOsVersion.pas
Marc Durdin 0f281a6a9d maint(windows): remove koSwitchLanguageForAllApplications, koAutoSwitchOSKPages, osVista, osWin7, osWin8, cleanup
* Remove references to `koSwitchLanguageForAllApplications` and
  `koAutoSwitchOSKPages` options, translated strings for them, and
  related `GlobalKeyboardChangeManager` -- no longer required since
  Win8.
* Remove Windows Vista-, 7-, and 8-specific code paths - except for the
  one user-facing setting for installing keyboards on downlevel
  operating systems.
* Remove commented code

Fixes: #16433
Test-bot: skip
2026-08-27 07:47:25 +02:00

58 lines
1.3 KiB
ObjectPascal

(*
Name: GetOsVersion
Copyright: Copyright (C) SIL International.
Documentation:
Description:
Create Date: 4 Dec 2006
Modified Date: 28 May 2014
Authors: mcdurdin
Related Files:
Dependencies:
Bugs:
Todo:
Notes:
History: 04 Dec 2006 - mcdurdin - Add osVista
04 May 2012 - mcdurdin - I3306 - V9.0 - Remove TntControls + Win9x support
24 Oct 2012 - mcdurdin - I3487 - V9.0 - Add detection of Win8
13 Dec 2012 - mcdurdin - I3669 - V9.0 - Eliminate old Windows version tests and constants
28 May 2014 - mcdurdin - I4222 - V9.0 - Deprecate osWin2000, osWinXP, osWin2003Server
*)
unit GetOsVersion; // I3306
interface
uses
Winapi.Windows;
type
TOS = (osLegacy, osWin10, osOther); // I3669 // I4222
function GetOs: TOS;
implementation
function GetOs: TOS;
var
osv: TOSVersionInfo;
begin
osv.dwOSVersionInfoSize := SizeOf(TOSVersionInfo);
GetVersionEx(osv);
Result := osOther;
if osv.dwPlatformId = VER_PLATFORM_WIN32_NT then // I3669
begin
case osv.dwMajorVersion of
5: Result := osLegacy;
6: Result := osLegacy;
10: Result := osWin10;
else
Result := osWin10;
end;
end;
end;
end.