Как узнать версию Windows 2
Как узнать версию Windows 2
Узнать версию Windows type twinversion = (wvunknown, wv95, wv98, wvme, wvnt3, wvnt4, wvw2k, wvxp); function detectwinversion: twinversion; var osversioninfo: tosversioninfo; begin result := wvunknown; osversioninfo.dwosversioninfosize := sizeof(tosversioninfo); if getversionex(osversioninfo) then begin case osversioninfo.dwmajorversion of 3: result := wvnt3; 4: case osversioninfo.dwminorversion of 0: if osversioninfo.dwplatformid = ver_platform_win32_nt then result := wvnt4 else result := wv95; 10: result := wv98; 90: result := wvme; end; 5: case osversioninfo.dwminorversion of 0: result := wvw2k; 1: result := wvxp; end; end; end; end; function detectwinversionstr: string; const versstr: array[twinversion] of string = ( 'unknown', 'windows 95', 'windows 98', 'windows me', 'windows nt 3', 'windows nt 4', 'windows 2000', 'windows xp'); begin result := versstr[detectwinversion]; end; procedure tform1.button1click(sender: tobject); begin ver := detectwinversion; label1.caption := inttostr(ord(detectwinversion)); label2.caption := detectwinversionstr; end; Источник: delphiworld