Thursday, February 22, 2007

Determining the operating system in Delphi

To determine the version of the operating system in Delphi, use the following constants defined in SysUtils.
  • Win32MajorVersion
  • Win32MinorVersion
  • Win32Platform

Vista (or higher)
Win32MajorVersion = 6

Server 2003
Win32MajorVersion = 5
Win32MinorVersion = 2

XP
Win32MajorVersion = 5
Win32MinorVersion = 1

2000
Win32MajorVersion = 5
Win32MinorVersion = 0

ME
Win32MajorVersion = 4
Win32MinorVersion = 90

98
Win32MajorVersion = 4
Win32MinorVersion = 10

NT4
Win32MajorVersion = 4
Win32MinorVersion = 0
Win32Platform = VER_PLATFORM_WIN32_NT

95
Win32MajorVersion = 4
Win32MinorVersion = 0
Win32Platform = VER_PLATFORM_WIN32_WINDOWS

0 comments:

Post a Comment

I get a lot of comment spam :( - moderation may take a while.