Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How To Determine A Machine's Locale / Regional Settings
Message
De
14/02/2000 19:28:42
 
 
À
14/02/2000 16:53:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00331942
Message ID:
00331999
Vues:
14
>Hi Folks,
>
>Is there a WIN32 call that can be used on Win9x and NT4/Win2000 to determine what country the PC running is in? For example, I want a setup program to do different things if the PC is setup for the US as opposed to the UK.
>
>TIA, Kevin


Hi Kevin,

You can use the following way to determine the country:
&& ==================================================

Declare Integer GetLocaleInfo In Win32API Integer, Integer, String @, Integer

cCountry=Repl(Chr(0), 1024)    && Buffer for country name
nLocID=0                   && Locale identifier (Default system locale)
nLocType=0x00001002        && Type of information (Full English name of the country)

nResult=GetLocaleInfo(nLocID, nLocType, @cCountry, 1020)

If nResult > 0
   && No errorrs
   cCountry = Left( cCountry, nResult - 1)
Else
   cCountry = '?????????'
EndIf

&& ==================================================
Good luck!

Alex
Alex
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform