Título: como saber el idioma de windows
Publicado por: rembolso en 16 Mayo 2009, 05:47 am
hola quiero hacer una herramienta donde te diga el idioma de windows . pero no encuentro ninguna api para hacerla si me podrian dar una mano estaria muy bien :xD
Título: Re: como saber el idioma de windows
Publicado por: XcryptOR en 16 Mayo 2009, 06:20 am
Aquí Tienes lo que necesitas, saludos ;D Private Declare Function GetSystemDefaultLangID Lib "kernel32" () As Integer 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 Sub Form_Load() MsgBox LangID End Sub Public Function LangID() As String On Error Resume Next Dim sBuf As String * 255 Dim l As Long LCID = GetSystemDefaultLangID() l = GetLocaleInfo(LCID, &H4, sBuf, Len(sBuf)) LangID = Left(sBuf, l) End Function
Título: Re: como saber el idioma de windows
Publicado por: YST en 16 Mayo 2009, 09:06 am
Por si necesitas información sobre las 2 apis
GetLocaleInfo: http://allapi.mentalis.org/apilist/GetLocaleInfo.shtml
GetSystemDefaultLangID: http://msdn.microsoft.com/en-us/library/aa913453.aspx
Título: Re: como saber el idioma de windows
Publicado por: rembolso en 24 Mayo 2009, 23:48 pm
muchas gracias me sirvio vastante ;D
Título: Re: como saber el idioma de windows
Publicado por: rembolso en 25 Mayo 2009, 00:01 am
es posible saber en q pais estas o no
Título: Re: como saber el idioma de windows
Publicado por: h0oke en 25 Mayo 2009, 00:04 am
Public Function ObtenerIdioma(ByVal lInfo As Long) As String Dim Buffer As String, Ret As String Buffer = String$(256, 0) Ret = GetLocaleInfo(LOCALE_USER_DEFAULT, lInfo, Buffer, Len(Buffer)) 'Si Ret devuelve 0 es porque falló la llamada al Api If Ret > 0 Then ObtenerIdioma = Left$(Buffer, Ret - 1) Else ObtenerIdioma = "" End If End Function 'Mostramos el mensaje con el idioma del Sistema y el país '********************************************************* Private Sub Command1_Click() MsgBox "Usted vive en: " & ObtenerIdioma(LOCALE_SENGCOUNTRY) _ & " (" & ObtenerIdioma(LOCALE_SNATIVECTRYNAME) & ")," & _ vbCrLf & "y el idioma es: " & ObtenerIdioma(LOCALE_SENGLANGUAGE) & " (" & ObtenerIdioma(LOCALE_SNATIVELANGNAME) & ").", vbInformation End Sub
Título: Re: como saber el idioma de windows
Publicado por: h0oke en 25 Mayo 2009, 00:19 am
Por las dudas... Option Explicit '************************************ 'Constantes para el Api GetLocaleInfo '************************************ Const LOCALE_USER_DEFAULT = &H400 Const LOCALE_SENGCOUNTRY = &H1002 Const LOCALE_SENGLANGUAGE = &H1001 Const LOCALE_SNATIVELANGNAME = &H4 Const LOCALE_SNATIVECTRYNAME = &H8 'Declaración de la función Api GetLocaleInfo 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
|