Date: 05/19/06 (Code WTF) Keywords: no keywords function IsWin2000: Boolean; var OS: TOSVersionInfo; begin ZeroMemory(@OS, SizeOf(OS)); OS.dwOSVersionInfoSize := SizeOf(OS); GetVersionEx(OS); result := (OS.dwMajorVersion >= 5) and (OS.dwPlatformId = VER_PLATFORM_WIN32_NT); end; function IsWinXP: Boolean; var OS: TOSVersionInfo; begin ZeroMemory(@OS, SizeOf(OS)); OS.dwOSVersionInfoSize := SizeOf(OS); GetVersionEx(OS); result := (OS.dwMajorVersion >= 5) and (OS.dwMinorVersion >= 1) and (OS.dwPlatformId = VER_PLATFORM_WIN32_NT); end; отсюда Там еще много интересного: procedure CheckOSVersion;
Var
GETOS : String;
GETOSMajor : String;
begin
if IsWinXP = TRUE then begin
GETOS := 'Windows XP';
GETOSMajor := 'Windows NTx';
end
else
if IsWinMe = TRUE then begin
GETOS := 'Windows ME';
GETOSMajor := 'Windows 9x';
end
else
if IsWin98se = TRUE then begin
GETOS := 'Windows 98SE';
GETOSMajor := 'Windows 9x';
end
else
if IsWin98 = TRUE then begin
GETOS := 'Windows 98';
GETOSMajor := 'Windows 9x';
end
else
if IsWin95OSR2 = TRUE then begin
GETOS := 'Windows 95B';
GETOSMajor := 'Windows 9x';
end
else
if IsWin95 = TRUE then begin
GETOS := 'Windows 95A';
GETOSMajor := 'Windows 9x';
end
else
if IsWinNT = TRUE then begin
GETOSMajor := 'Windows NTx';
GETOS := GetNTType;
end;
Source: http://community.livejournal.com/code_wtf/38548.html
|