Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "WinAPI";
Текущий архив: 2002.08.08;
Скачать: [xml.tar.bz2];

Вниз

Глупый вопрос! Но...   Найти похожие ветки 

 
AlexanderSK   (2002-05-24 15:36) [0]

Как определить версию Windows, а точнее группу Win95,98,ME или WinNT,2000,XP?

Заранее спасибо!


 
arbiter   (2002-05-24 18:22) [1]

GetVersion and $80000000 > 0 => Win9x


 
Zyv   (2002-05-24 18:22) [2]

If Win32Platform = VER_PLATFORM_WIN32_WINDOWS Then
...Win95,98,ME

If Win32Platform = VER_PLATFORM_WIN32_NT Then
...WinNT,2000,XP


 
Viewer   (2002-05-24 22:58) [3]

Выдернул из своей DLL

function Win: PChar; stdcall; export;
var fOS:TOsVersionInfo;
fWin: string;
fSP: string;
begin
fWin := "unrecognize";
fOS.dwOsVersionInfoSize:=SizeOf(fOS);
GetVersionEx(fOS);
fSP := string(fOS.szCSDVersion);
case fOS.dwPlatformId of
VER_PLATFORM_WIN32S : fWin:="Windows"; // =0
VER_PLATFORM_WIN32_WINDOWS : // =1
case fOS.dwMinorVersion of
0: fWin:="Windows 95";
9: fWin:="Windows Millenium";
10: fWin:="Windows 98";
end;
VER_PLATFORM_WIN32_NT :
case fOS.dwMajorVersion of // =2
3: fWin:="Windows NT 3.51";
4: fWin:="Windows NT 4.0";
5: begin
if fOS.dwMinorVersion=0 then fWin:="Windows 2000";
if fOS.dwMinorVersion=1 then fWin:="Windows XP";
end;
end;
else
fWin:="unknown Windows platform ";
end;
result := PChar(fWin);
end;


 
Wizard_Ex   (2002-05-26 12:23) [4]

или


procedure TAboutForm.ShowSystemPlatform;
var data:OSVERSIONINFO;
Winda:string;
begin
data.dwOSVersionInfoSize:=sizeof(OSVERSIONINFO);
GetVersionEx(data);
Winda:="Windows ??";
case data.dwPlatformId of
VER_PLATFORM_WIN32s:Winda:="Windows 3.11";
VER_PLATFORM_WIN32_WINDOWS:
begin
if data.dwMajorVersion>=4 then
begin
if data.dwMinorVersion<10 then Winda:="Windows 95 "+
inttostr(data.dwMajorVersion)+"."+
inttostr(data.dwMinorVersion)+" (Build "+IntToStr(data.dwBuildNumber)+") "+
data.szCSDVersion;
if data.dwMinorVersion>=10 then
if data.szCSDVersion[1]="A" then
Winda:="Windows 98 "+
inttostr(data.dwMajorVersion)+"."+
inttostr(data.dwMinorVersion)+
" SE"+" (Build "+IntToStr(data.dwBuildNumber)+")"
else
Winda:="Windows 98 "+
inttostr(data.dwMajorVersion)+"."+
inttostr(data.dwMinorVersion)+" (Build "+IntToStr(data.dwBuildNumber)+") "+
data.szCSDVersion;

if data.dwMinorVersion>=90 then Winda:="Windows ME "+
inttostr(data.dwMajorVersion)+"."+
inttostr(data.dwMinorVersion)+" (Build "+IntToStr(data.dwBuildNumber)+") "+
data.szCSDVersion;
end;
end;
VER_PLATFORM_WIN32_NT:
begin
if data.dwMajorVersion<=4 then Winda:="Windows NT "+
inttostr(data.dwMajorVersion)+"."+
inttostr(data.dwMinorVersion)+" (Build "+IntToStr(data.dwBuildNumber)+") "+
data.szCSDVersion;;
if data.dwMajorVersion=5 then
begin
if data.dwMinorVersion=0 then Winda:="Windows 2000 "+
inttostr(data.dwMajorVersion)+"."+
inttostr(data.dwMinorVersion)+" (Build "+IntToStr(data.dwBuildNumber)+") "+
data.szCSDVersion;;
if data.dwMinorVersion>=1 then Winda:="Windows XP "+
inttostr(data.dwMajorVersion)+"."+
inttostr(data.dwMinorVersion)+" (Build "+IntToStr(data.dwBuildNumber)+") "+
data.szCSDVersion;;
end;
end;
end;
OS.Caption:=Winda;
end;


где OS это TLabel на форме


 
Вадим02   (2002-06-01 05:29) [5]

Все очень просто!

begin
if (GetVersion() and $80000000)<>0 then
Label3.caption:="Windows 95/98"
else
Label3.caption:="Windows NT/2000/XP";



Страницы: 1 вся ветка

Форум: "WinAPI";
Текущий архив: 2002.08.08;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.46 MB
Время: 0.007 c
4-24265
Melamed
2002-05-31 00:19
2002.08.08
Проблема с написанием своего компанента


3-23961
Doctor
2002-07-19 11:27
2002.08.08
Year,Month,Day


1-24060
BOPOH
2002-07-24 13:54
2002.08.08
Вопрос по бордюру окна


14-24174
Johnmen
2002-07-11 14:20
2002.08.08
Проблема с IDE


6-24149
Delphi5.01
2002-05-28 07:16
2002.08.08
Считывание информации с FTP сервера.





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский