Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to Check Language in VFP app.
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00726646
Message ID:
00726881
Views:
14
>Can anyone tell me how I can check what regional setting or langauge a user is operating under. For instance, if a user of my VFP application is running on the Chinese version of Windows, how can I check for this? Is there a VFP command/function (the OS() function doesn't seem to be appropriate) or is there an Windows API call or something else?

Hi,
#define LOCALE_USER_DEFAULT           BitLShift(0x01, 10)    && user default
#define LOCALE_SYSTEM_DEFAULT         BitLShift(0x02, 10)    && system default

#define LOCALE_SENGLANGUAGE           0x00001001   && English name of language
#define LOCALE_SABBREVLANGNAME        0x00000003   && abbreviated language name
#define LOCALE_SNATIVELANGNAME        0x00000004   && native name of language

Declare Integer GetLocaleInfo in Win32API ;
    Long Locale, Long LCType, String @ LCData, Integer size
Buff = Space(256)

* English name of user default language
len = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SENGLANGUAGE, @Buff, 256)
? Left(Buff, len-1)
* Abbreviated name of system language
len = GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SABBREVLANGNAME, @Buff, 256)
? Left(Buff, len-1)
* Native name of system language
len = GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_SNATIVELANGNAME, @Buff, 256)
? Left(Buff, len-1)
HTH,
Alexander
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform