{
Value                         Platform
VER_PLATFORM_WIN32s Win32s on Windows 3.1. 
VER_PLATFORM_WIN32_WINDOWS Win32 on Windows 95.
VER_PLATFORM_WIN32_NT Win32 on Windows NT.
}
(*判断是否是NT*)
function IsNT: Boolean ;
var
  OSVersionInfo: TOSVersionInfo;
begin
  OSVersionInfo.dwOSVersionInfoSize := SizeOf(OSVersionInfo);
  GetVersionEx(OSVersionInfo);
  if OSVersionInfo.dwPlatformId = VER_PLATFORM_WIN32_NT then
    Result := True
  else
    Result := False;
end;

解决方案 »

  1.   

    //==============================================================================
    //获得操作系统版本号************************************************************
    //==============================================================================
    function GetWindowsVersion(var Major, Minor: integer): string;
    var
      {$IFDEF WIN32}
      lpOS, lpOS2: POsVersionInfo;
      OSVerProc: function(lpOs: pointer): BOOL; stdcall;
      OSVerHandle: THandle;
      {$ELSE}
      lp: longint;
      {$ENDIF}
    begin
      {$IFDEF WIN32}
      GetMem(lpOS, SizeOf(TOsVersionInfo));
      lpOs^.dwOSVersionInfoSize := SizeOf(TOsVersionInfo);
      //============================================================================
      //调用DLL例程*****************************************************************
      //============================================================================
      OSVerHandle := LoadLibrary('kernel32');
      if OSVerHandle<=0
      then raise Exception.Create('动态链接库kernel32加载失败,错误代码:'+IntToStr(GetLastError))
      else @OSVerProc := GetProcAddress(OSVerHandle, 'GetVersionExA');
      if not Assigned(OSVerProc)
      then raise Exception.Create('动态链接库kernel32函数GetVersionExA加载失败,错误代码:'+IntToStr(GetLastError))
      else while not OSVerProc(lpOS) do
           begin
             GetMem(lpos2, lpos^.dwOSVersionInfoSize + 1);
             lpOs2^.dwOSVersionInfoSize := lpOs^.dwOSVersionInfoSize + 1;
             FreeMem(lpOs, lpOs^.dwOSVersionInfoSize);
             lpOS := lpOs2;
           end;
      Major := lpOs^.dwMajorVersion;
      Minor := lpOs^.dwMinorVersion;
      FreeLibrary(OSVerHandle);
      FreeMem(lpOs, lpOs^.dwOSVersionInfoSize);
      {$ELSE}
      lp := GetVersion;
      Major := LoByte(LoWord(lp));
      Minor := HiByte(LoWord(lp));
      {$ENDIF}
      case Win32Platform of
        VER_PLATFORM_WIN32_WINDOWS: Result := 'Win9x';
        VER_PLATFORM_WIN32_NT:      Result := 'WinNT';
      end;
    end;