Function WinVer: string; var
VersionInfo: TOSVersionInfo; begin
VersionInfo.dwOSVersionInfoSize := SizeOf(VersionInfo);
GetVersionEx(VersionInfo); with VersionInfo do begin case dwPlatformid of
0 : begin
result := 'Windows 3.11'; end;
1 : begin case dwMinorVersion of
0 : result := 'Windows 95';
10: begin if ( szCSDVersion[ 1 ] = 'A' ) then
Result :='Windows 98 SE' else
Result := 'Windows 98'; end;
90 : result := 'Windows Millenium'; else
result := 'Versão Desconhecida'; end; end;
2 : begin case dwMajorVersion of
3 : result := 'Windows NT ' + IntToStr(dwMajorVersion) + '.' + IntToStr(dwMinorVersion);
4 : result := 'Windows NT ' + IntToStr(dwMajorVersion) + '.' + IntToStr(dwMinorVersion);
5 : begin case dwMinorVersion of
0 : result := 'Windows 2000';
1 : result := 'Windows XP'; end; end;
6 : result := 'Windows Vista'; else
result := 'Versão Desconhecida'; end; if szCSDVersion <> '' then
result := result + ' ' + szCSDVersion; end; else
result := 'Plataforma Desconhecida'; end;
result := result + ' Build ' + IntToStr(Loword(dwBuildNumber)) ; end; end;