Retrieve Localization Strings

Retrieve Localization Strings

Use this API function wrapper to retrieve localization and personalization information:

 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 Public Function WinLocaleInfo(ByVal lnfoType As _	Long) As String	Dim sLCData As String	Dim nRet As Long	nRet = GetLocaleInfo(0, lnfoType, sLCData, 0)	If nRet Then		sLCData = Space$(nRet)		nRet = GetLocaleInfo(0, lnfoType, _			sLCData, Len(sLCData))		If nRet Then			WinLocaleInfo = Left$(sLCData, nRet)		End If	End IfEnd Function

Here are some of the handier parameters you can use for information:

 	LOCALE_SCURRENCY = &H14	' local monetary symbol	LOCALE_SDATE = &H1D	' date separator	LOCALE_SDAYNAME1 = &H2A	' long name for Monday	LOCALE_SDECIMAL = &HE	' decimal separator


Share the Post: