type struct{
DWORD dwOSVersionInfoSize
//版本信息结构大小
DWORD dwMajorVersion
//主版本号win98,nt4.0都为 4
DWORD dwMinorVersion
//次版本号win98-10,nt4.0-0
DWORD dwBuildNumber
//构件数
DWORD dwPlatformId
//平台标识
// VER_PLATFORM_WIN32S Windows3.1
// VER_PLATFORM_WIN32_WINDOWS Windows95
// VER_PLATFORM_WIN32_NT Windows NT
TCHAR szCSDVersion[128];
}OSVERSIONINFO;
procedure TForm1.Button1Click(Sender: TObject);
var
pOSVI: OSVERSIONINFO;
begin
// 设置版本信息结构的大小
pOSVI.dwOSVersionInfoSize:=sizeof(OSVERSIONINFO);
// 获取版本信息
GetVersionEx( pOSVI );
// 显示信息
Edit1.Text:=IntToStr(pOSVI.dwMajorVersion)+'.'
+IntToStr(pOSVI.dwMinorVersion)+'.'
+IntToStr(pOSVI.dwBuildNumber)+'.'
+IntToStr(pOSVI.dwPlatformId)+'.'
+pOSVI.szCSDVersion;
end;