realbasic-nug.fr
[Top] [All Lists]

Re: Vérifier l'os

To: REALbasic NUG French <realbasic-nug.fr@lists.realsoftware.com>
Subject: Re: Vérifier l'os
From: Stephane Pinel <stephane@realsoftware.fr>
Date: Fri, 25 Jul 2008 18:57:18 +0200
Authentication-results: mx.google.com; spf=neutral (google.com: 74.124.194.228 is neither permitted nor denied by best guess record for domain of realbasic-nug.fr-bounces@lists.realsoftware.com) smtp.mail=realbasic-nug.fr-bounces@lists.realsoftware.com
Delivered-to: listarchive@realsoftware.com
In-reply-to: <0A01EE8D-4C57-4F0F-899C-80E5150FDF6D@mac.com>
References: <9963CB81-7731-4904-B6A4-FEB3F50E3709@mac.com> <232AD192-C286-41E9-A812-A6207EE92865@billjobs.com> <0A01EE8D-4C57-4F0F-899C-80E5150FDF6D@mac.com>
Reply-to: REALbasic NUG French <realbasic-nug.fr@lists.realsoftware.com>
Sender: realbasic-nug.fr-bounces@lists.realsoftware.com
Ou dans le SearchField de la doc en ligne "System" ;-)

A+

---
Stéphane Pinel - REAL Software
Support Technique en Français
43, Rue Marius Aufan 92300 Levallois-Perret (FR)
http://www.realsoftware.fr

Rejoignez la communauté francophone des développeurs REALbasic :
<http://www.realsoftware.com/support/listmanager/>

Le 25 juil. 08 à 18:54, Sébastien Debiève a écrit :

Merci beaucoup c'était à "sysv" que je devais chercher.

Sébastien

Le 25-juil.-08 à 18:46, Vincent Mercey a écrit :


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









<Prev in Thread] Current Thread [Next in Thread>