[COLOR=blue]Private[/COLOR] [COLOR=blue]Const[/COLOR] LOCALE_ILANGUAGE [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR] = &H1
[COLOR=blue]Private[/COLOR] [COLOR=blue]Const[/COLOR] LOCALE_SCOUNTRY [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR] = &H6
[COLOR=blue]Private[/COLOR] [COLOR=blue]Declare[/COLOR] [COLOR=blue]Function[/COLOR] GetKeyboardLayout [COLOR=blue]Lib[/COLOR] "user32" _
([COLOR=blue]ByVal[/COLOR] dwLayout [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR]) [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR]
[COLOR=blue]Private[/COLOR] [COLOR=blue]Declare[/COLOR] [COLOR=blue]Function[/COLOR] GetLocaleInfo [COLOR=blue]Lib[/COLOR] "kernel32" _
[COLOR=blue]Alias[/COLOR] "GetLocaleInfoA" _
([COLOR=blue]ByVal[/COLOR] Locale [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR], _
[COLOR=blue]ByVal[/COLOR] LCType [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR], _
[COLOR=blue]ByVal[/COLOR] lpLCData [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR], _
[COLOR=blue]ByVal[/COLOR] cchData [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR]) [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR]
[COLOR=blue]Public[/COLOR] [COLOR=blue]Sub[/COLOR] ShowLangauges()
[COLOR=blue]Dim[/COLOR] hKeyboardID [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR]
[COLOR=blue]Dim[/COLOR] LCID [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR]
hKeyboardID = GetKeyboardLayout(0&)
[COLOR=blue]If[/COLOR] hKeyboardID > 0 [COLOR=blue]Then[/COLOR]
LCID = LoWord(hKeyboardID)
[COLOR=blue]Debug.Print[/COLOR] GetUserLocaleInfo(LCID, LOCALE_ILANGUAGE)
[COLOR=blue]Debug.Print[/COLOR] GetUserLocaleInfo(LCID, LOCALE_SCOUNTRY)
[COLOR=blue]End[/COLOR] [COLOR=blue]If[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]Sub[/COLOR]
[COLOR=blue]Private[/COLOR] [COLOR=blue]Function[/COLOR] LoWord(wParam [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR]) [COLOR=blue]As[/COLOR] [COLOR=blue]Integer[/COLOR]
[COLOR=blue]If[/COLOR] wParam [COLOR=blue]And[/COLOR] &H8000& [COLOR=blue]Then[/COLOR]
LoWord = &H8000& [COLOR=blue]Or[/COLOR] (wParam [COLOR=blue]And[/COLOR] &H7FFF&)
[COLOR=blue]Else[/COLOR]
LoWord = wParam [COLOR=blue]And[/COLOR] &HFFFF&
[COLOR=blue]End[/COLOR] [COLOR=blue]If[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]Function[/COLOR]
[COLOR=blue]Public[/COLOR] [COLOR=blue]Function[/COLOR] GetUserLocaleInfo([COLOR=blue]ByVal[/COLOR] dwLocaleID [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR], _
[COLOR=blue]ByVal[/COLOR] dwLCType [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR]) [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR]
[COLOR=blue]Dim[/COLOR] sReturn [COLOR=blue]As[/COLOR] [COLOR=blue]String[/COLOR]
[COLOR=blue]Dim[/COLOR] nSize [COLOR=blue]As[/COLOR] [COLOR=blue]Long[/COLOR]
nSize = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, [COLOR=blue]Len[/COLOR](sReturn))
[COLOR=blue]If[/COLOR] nSize > 0 [COLOR=blue]Then[/COLOR]
sReturn = [COLOR=blue]Space$[/COLOR](nSize)
nSize = GetLocaleInfo(dwLocaleID, dwLCType, sReturn, [COLOR=blue]Len[/COLOR](sReturn))
[COLOR=blue]If[/COLOR] nSize > 0 [COLOR=blue]Then[/COLOR]
GetUserLocaleInfo = [COLOR=blue]Left$[/COLOR](sReturn, nSize - 1)
[COLOR=blue]End[/COLOR] [COLOR=blue]If[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]If[/COLOR]
[COLOR=blue]End[/COLOR] [COLOR=blue]Function[/COLOR]