Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How To Determine A Machine's Locale / Regional Settings
Message
From
14/02/2000 19:28:42
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00331942
Message ID:
00331999
Views:
16
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform