I'm trying to get the version of Windows 10 on my system, but the maximum it displays is Windows 8. Nor does it 8.1 it displays. I could not find the error.
// 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