6
I am trying to get the version of Windows 10 on my system, but the most it displays is Windows 8. Neither 8.1 it displays. I couldn’t find the mistake.
// Função Sistema Operacional
function WinVersion: string;
var
VersionInfo: TOSVersionInfo;
begin
VersionInfo.dwOSVersionInfoSize:=SizeOf(VersionInfo);
GetVersionEx(VersionInfo);
Result:='';
with VersionInfo do
begin
case dwPlatformId of
1:
case dwMinorVersion of
0: Result:='Microsoft Windows 95';
10: Result:='Microsoft Windows 98';
90: Result:='Microsoft Windows Me';
end;
2:
case dwMajorVersion of
5:
case dwMinorVersion of
0:
Result := 'Microsoft Windows 2000';
1:
Result := 'Microsoft Windows XP';
2:
Result := 'Microsoft Windows Server 2003';
end;
6:
case dwMinorVersion of
0:
Result := 'Microsoft Windows Vista';
1:
Result := 'Microsoft Windows 7';
2:
Result := 'Microsoft Windows 8';
3:
Result := 'Microsoft Windows 8.1';
end;
10:
case dwMajorVersion of
0:
Result := 'Microsoft Windows 10';
end;
end;
end;
end;
if (Result='') then
Result:='Sistema operacional desconhecido.';
end;
// Fim da Função SO
Perfect thank you!
– rafaeloliveira
Very good, I tested on Windows 8, 10 and on the server and it worked, congratulations.
– user41558
Thank you very much, it worked right.
– Gisele M.