Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get measurement system
Message
De
08/07/2003 12:16:45
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00807522
Message ID:
00808065
Vues:
24
Hi Alexander.

>>I'm trying to figure out how to determine what measurement system (U.S. or metric) the user has selected in the Regional Settings applet of the Control Panel. I've been through the API Functions forum here and MSDN, but can't seem to find what I need. Anyone have an idea? TIA.
>
>Doug,
>
>#define LOCALE_USER_DEFAULT 0x2
>#define LOCALE_IMEASURE 0xD
>Declare Long GetLocaleInfo IN WIN32API ;
>	Long Locale, Long LCType, String @ buf, Long BufSize
>
>buf = Replicate(CHR(0), 4)
>GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IMEASURE, @buf, 4)
>? Left(buf, 1)
>
>0 - metric system,
>1 - U.S. system.

Thanks for your reply. However, I always get 0, regardless of the measurement setting. George's suggestion of using the Registry key does show the correct value.

Doug
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform