Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Sep 23, 1999

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 If
End 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
Brian Morris
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date