Mega Code Archive

 
Categories / Delphi / Examples
 

How to detect the windows os version

This short function will return what version of windows the application is currently running on. type TWindowsVersion = (wvWin9x, wvWinNT, wvWin2k, wvWinXP); function GetWindowsVersion: TWindowsVersion; begin Result := wvWin9x; if Win32Platform = VER_PLATFORM_WIN32_NT then case Win32MajorVersion of 3..4: Result := wvWinNT; 5: case Win32MinorVersion of 0: Result := wvWin2k; 1: Result := wvWinXP; end; end; end;