Did you know you can get the Users Country by calling the GetLocaleInfo API 
using the NEW DLCall function?

Here's how:

{
   only call STDCALL for this function ONCE per session
   Fill the lplcdata variable with nulls the length of our pointer PTR to it 
passed to the function
   The function will populate the pointer variable with the country name

}
STDCALL function 'GetLocaleInfoA' ALIAS 'GetLocaleInfo' (integer, ptr text 
(48), integer, integer) : integer


SET VAR lplcdata TEXT = (SFIL((CHAR(0)),48))

SET VAR USER_DEFAULT INTEGER = 1024
SET VAR sengcountry  INTEGER = 4098 -- English name of country
SET VAR SENGLANGUAGE  INTEGER = 4097  -- English name of language
SET VAR SNATIVELANGNAME INTEGER = 4  -- native name of language
SET VAR SNATIVECTRYNAME INTEGER = 8

SET VAR i INTEGER = 0

SET VAR i = (dlcall('Kernel32','GetLocaleInfo', 48, lplcdata, SNATIVECTRYNAME, 
USER_DEFAULT))

PAUSE 2 USING .lplcdata
RETURN 


Reply via email to