调用Windows API函数GetVersionEx可以获得Windows的版本信息。
如:
procedure TForm1.Button1Click(Sender: TObject);
var
VersionInfo: TOSVersionInfo;
begin
VersionInfo.dwOSVersionInfoSize := Sizeof(TOSVersionInfo);
GetVersionEx(VersionInfo);
case VersionInfo.dwPlatformID of
VER_PLATFORM_WIN32S:
Do_SomeThing;
VER_PLATFORM_WIN32_WINDOWS:
Do_SomeOtherThing;
VER_PLATFORM_WIN32_NT:
Do_SomeThingelse
;
end;
end;