Retrieve System Language

BlitzMax Forums/BlitzMax Programming/Retrieve System Language

I managed to get this to work:

Extern "Win32"
	Function GetSystemDefaultLangID:Int()
	Function VerLanguageNameA:Int(LangID:Int,Name:Byte Ptr,MaxSize:Int)
End Extern

Local ID:Int = GetSystemDefaultLangID()

Local TmpString:Byte Ptr = MemAlloc(30)

Print VerLanguageNameA(ID,TmpString,30)

Local LangName:String = ""

For Local Count:Int = 0 To 29
	LangName = LangName+Chr(TmpString[Count])
Next

Print LangName	
	
MemFree(TmpString)


There might be a better way but I'm not good at coming up with the best way to do things :)

I'm not sure what the max size of the memory needs to be but 30 was larger than what VerLanguageName was returning.