GetVersion api fonksiyonu kullanilarak, calismakta olan Windows'un sürüm numarasi nasil alinabilir. Bu fonksiyonun dödürdügü sonuc icerisinde sürüm numarasi nasil ayiklanir?
program Winvrsn;
uses
WinTypes,
WinProcs,
SysUtils;
procedure TForm1.Button2Click(Sender: TObject);
var
WinVersion : Word;
DosVersion : Word;
VersionString : String;
begin
WinVersion := GetVersion and $0000FFFF;
DosVersion := (GetVersion and $FFFF0000) shr 16;
VersionString := 'DOS : ' + IntToStr(Hi(DOSVersion)) + '.' + IntToStr(Lo(DOSVersion)) + #13 +
'Windows : '+ IntToStr(Lo(WinVersion)) + '.' + IntToStr(Hi(WinVersion)) + #0;
MessageBox(0, @VersionString[1],'Version Information', MB_ICONINFORMATION or MB_OK)
end;