Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. 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
  2.  
  3. Private Sub form_load()
  4.  
  5. MsgBox CountryTag
  6.  
  7. End Sub
  8.  
  9. Public Function CountryTag() As String
  10. Dim buffer As String * 100
  11. Dim dl&
  12. dl& = GetLocaleInfo(0, &H1002, buffer, 99)
  13. CountryTag = ((LPSTRToVBString(buffer)))
  14. End Function
  15. Public Function LPSTRToVBString$(ByVal s$)
  16. Dim nullpos&
  17. nullpos& = InStr(s$, Chr$(0))
  18. If nullpos > 0 Then
  19. LPSTRToVBString = Left$(s$, nullpos - 1)
  20. Else
  21. LPSTRToVBString = ""
  22. End If
  23. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement