Soyez le premier à donner votre avis sur cette source.
Snippet vu 3 902 fois - Téléchargée 29 fois
// Créer un type type TWindowsVersion = (twvunknow, twvwin31, twvwin951, twvwin952, twvwin981, twvwin982, twvwinme, twvwin9x, twvwinnt35, twvwinnt4, twvwin2k, twvwinxp, twvwinnt); //************************************************************* // Fonction Trouvant la Version de Windows //************************************************************* function WindowsVersion():TWindowsVersion; var VI : TOSVersionInfo; WinVersion : TWindowsVersion; begin VI.dwOSVersionInfoSize:= SizeOf(VI); GetVersionEx(VI); WinVersion := twvunknow ; case VI.dwPlatformID of VER_PLATFORM_WIN32s: WinVersion := twvwin31; VER_PLATFORM_WIN32_WINDOWS: begin case VI.dwMinorVersion of 0 : if Trim(VI.szCSDVersion[1]) = 'B' then WinVersion:= twvwin952 else WinVersion:= twvwin951; 10 : if Trim(VI.szCSDVersion[1]) = 'A' then WinVersion:= twvwin982 else WinVersion:= twvwin981; 90 : if (VI.dwBuildNumber = 73010104) then WinVersion:= twvwinme; else WinVersion:= twvwin9x; end; end; VER_PLATFORM_WIN32_NT: begin case VI.dwMajorVersion of 3 : WinVersion:= twvwinnt35; 4 : WinVersion:= twvwinnt4; 5 : case VI.dwMinorVersion of 0 : WinVersion:= twvwin2k; 1 : WinVersion:= twvwinxp; end; else WinVersion:= twvwinnt; end; end; end; result := WinVersion; end; // on récupère le résultat ainsi: // VERSION DE WINDOWS WinVer := WindowsVersion(); Case WinVer of twvunknow : label_win.Caption := 'Inconnu'; twvwin31 : showmessage('Windows 3.1'); twvwin951 : showmessage('Windows 95 OSR 1'); twvwin952 : showmessage('Windows 95 OSR 2'); twvwin981 : showmessage('Windows 98 OSR 1'); twvwin982 : showmessage('Windows 98 OSR 2'); twvwinme : showmessage('Windows Me'); twvwin9x : showmessage('Windows 9x'); // Si Windows Inconnu parmis les Win9x twvwinnt35 : showmessage('Windows NT 3.5'); twvwinnt4 : showmessage('Windows NT 4'); twvwin2k : showmessage('Windows 2000'); twvwinxp : showmessage('Windows XP'); twvwinnt : showmessage('Windows NT'); // Si Windows Inconnu parmis les WinNT else showmessage('Inconnu'); // Si Windows Inconnu end;
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.