Le 25 juil. 08 à 18:37, Sébastien Debiève a écrit :
Bonjour,
Je cherche le code qui permet de faire vérifier quel système à
l'utilisateur.
Voilà ce que je veux faire =
si c'est supérieur à mac os 10.4 = lancé une action
j'ai cherché, mais je n'ai pas trouvé ou peut-être que je n'ai pas
mis le mot-clé correct ?
Ceci devrai faire l'affaire
(en tout cas une base pour faire mieux)
Protected Function SystemeQui() As string
#if targetWin32
return WINSystem() 'Peut être 'Windows 2000, Windows 98, Windows
XP, Windows NT
#else
Dim b as boolean
dim n as integer
b = system.gestalt("sysv",n)
return "Mac "+hex(n) 'Peut être 'Mac 1034, Mac 1028 etc....
#endif
End Function
Protected Function WINSystem() As string
#if targetwin32 then
dim m As MemoryBlock
dim n as Integer
Declare Function GetVersionEx Lib "kernel32.dll" Alias
"GetVersionExA" (lpVersionInformation as Ptr) As Integer
m = newMemoryBlock(256)
m.Long(0) = 148
n = GetVersionEx(m)
if m.Long(16) = 1 then
if m.Long(4) = 4 and m.Long(8) = 10 then
return "Windows 98"
end if
return "Windows 95"
elseif m.Long(16) = 2 then
if m.Long(4) = 5 and m.Long(8) = 1 then
return "Windows XP"
elseif m.Long(4) = 5 and m.Long(8) = 0 then
return "Windows 2000"
end if
return "Windows NT"
end if
#endif
End Function
Sincères salutations
----------------------------
Vincent MERCEY
http://www.billjobs.com