On my Windows 7 system, the GetVersionEx Windows API function returns “6.0”, indicating Windows Vista when it should return “6.1”.
If that matters, I used the following Delphi code:
function winver: string; var ver: TOSVersionInfo; begin ver.dwOSVersionInfoSize := SizeOf(ver); if GetVersionEx(ver) then with ver do result := IntToStr(dwMajorVersion) + '.' + IntToStr(dwMinorVersion) + '.' + IntToStr(dwBuildNumber) + ' (' + szCSDVersion + ')'; end;
and the string "6.0.6002 (Service Pack 2)" was returned.
Isn't that very strange?
windows-7 winapi delphi
Andreas Rejbrand
source share