Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to get measurement system
Message
From
08/07/2003 12:16:45
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00807522
Message ID:
00808065
Views:
23
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
Previous
Reply
Map
View

Click here to load this message in the networking platform