How can I detect what systemlanguage is running

How can I detect what systemlanguage is running

Post by JR » Fri, 14 Nov 2003 02:25:51


Thanks
 
 
 

How can I detect what systemlanguage is running

Post by Dag Sund » Fri, 14 Nov 2003 08:13:14


This should get you started (Paste into a Form):
(Things will wrap... Each Debug.Print should be a single line...)


'-------------------- Code:
Option Explicit
DefObj A-Z

Private Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA"
( _
ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String, _
ByVal cchData As Long _
) As Long

Private Const LANG_NEUTRAL = &H0

Private Const LOCALE_ILANGUAGE = &H1
Private Const LOCALE_SLANGUAGE = &H2
Private Const LOCALE_SENGLANGUAGE = &H1001
Private Const LOCALE_SABBREVLANGNAME = &H3
Private Const LOCALE_SNATIVELANGNAME = &H4
Private Const LOCALE_ICOUNTRY = &H5
Private Const LOCALE_SCOUNTRY = &H6
Private Const LOCALE_SENGCOUNTRY = &H1002
Private Const LOCALE_SABBREVCTRYNAME = &H7
Private Const LOCALE_SNATIVECTRYNAME = &H8
Private Const LOCALE_IDEFAULTLANGUAGE = &H9
Private Const LOCALE_IDEFAULTCOUNTRY = &HA
Private Const LOCALE_IDEFAULTCODEPAGE = &HB
Private Const LOCALE_IDEFAULTANSICODEPAGE = &H1004


Private Sub Form_Load()

Debug.Print "LOCALE_ILANGUAGE:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_ILANGUAGE)
Debug.Print "LOCALE_SLANGUAGE:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_SLANGUAGE)
Debug.Print "LOCALE_SENGLANGUAGE:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_SENGLANGUAGE)
Debug.Print "LOCALE_SABBREVLANGNAME:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_SABBREVLANGNAME)
Debug.Print "LOCALE_SNATIVELANGNAME:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_SNATIVELANGNAME)
Debug.Print "LOCALE_SCOUNTRY:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_SCOUNTRY)
Debug.Print "LOCALE_SENGCOUNTRY:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_SENGCOUNTRY)
Debug.Print "LOCALE_SABBREVCTRYNAME:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_SABBREVCTRYNAME)
Debug.Print "LOCALE_SNATIVECTRYNAME:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_SNATIVECTRYNAME)
Debug.Print "LOCALE_IDEFAULTLANGUAGE:" & vbTab &
GetNLSInfo(LANG_NEUTRAL, LOCALE_IDEFAULTLANGUAGE)
Debug.Print "LOCALE_IDEFAULTCOUNTRY:" & vbTab & GetNLSInfo(LANG_NEUTRAL,
LOCALE_IDEFAULTCOUNTRY)
Debug.Print "LOCALE_IDEFAULTCODEPAGE:" & vbTab &
GetNLSInfo(LANG_NEUTRAL, LOCALE_IDEFAULTCODEPAGE)
Debug.Print "LOCALE_IDEFAULTANSICODEPAGE:" & vbTab &
GetNLSInfo(LANG_NEUTRAL, LOCALE_IDEFAULTANSICODEPAGE)

End Sub

Private Function GetNLSInfo(CountryID As Long, InfoType As Long) As String

Dim iRet As Integer
Dim sBuf As String

sBuf = String$(255, Chr(0))
iRet = GetLocaleInfo(CountryID, InfoType, sBuf, 255)
GetNLSInfo = Left$(sBuf, iRet - 1)

End Function
'-------------------- End Code:

 
 
 

How can I detect what systemlanguage is running

Post by JR » Fri, 21 Nov 2003 14:14:40

thanks

--
Met vriendelijke groeten.
Jan
"Dag Sunde" < XXXX@XXXXX.COM > schreef in bericht



"GetLocaleInfoA"
GetNLSInfo(LANG_NEUTRAL,
GetNLSInfo(LANG_NEUTRAL,
GetNLSInfo(LANG_NEUTRAL,
GetNLSInfo(LANG_NEUTRAL,
GetNLSInfo(LANG_NEUTRAL,