Results 1 to 4 of 4

Thread: [RESOLVED] Windows Version Language

  1. #1

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Resolved [RESOLVED] Windows Version Language

    Hi.

    how do i find the Language of Windows installed in a computer.
    i.e. English, German, Friench etc.

    do i have to use an API or Just retrive it from the registry ?
    if it is retrived from the registry please tell me the key name only.


    Thank you.

  2. #2
    Hyperactive Member kazar's Avatar
    Join Date
    Apr 2006
    Location
    UK
    Posts
    323

    Re: Windows Version Language

    As far as i can tell, this is the best way to do it - using API:
    VB Code:
    1. Option Explicit
    2.  
    3. Const LOCALE_USER_DEFAULT = &H400
    4.  
    5. Const LOCALE_SENGCOUNTRY = &H1002 '  English name of country
    6.  
    7. Const LOCALE_SENGLANGUAGE = &H1001  '  English name of language
    8.  
    9. Const LOCALE_SNATIVELANGNAME = &H4  '  native name of language
    10.  
    11. Const LOCALE_SNATIVECTRYNAME = &H8  '  native name of country
    12.  
    13. 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
    14.  
    15. Public Function GetInfo(ByVal lInfo As Long) As String
    16.  
    17.     Dim Buffer As String, Ret As String
    18.  
    19.     Buffer = String$(256, 0)
    20.  
    21.     Ret = GetLocaleInfo(LOCALE_USER_DEFAULT, lInfo, Buffer, Len(Buffer))
    22.  
    23.     If Ret > 0 Then
    24.         GetInfo = Left$(Buffer, Ret - 1)
    25.     Else
    26.         GetInfo = ""
    27.     End If
    28.  
    29. End Function

    you can then call the getinfo function with any of the constants and get the language, country, whatever.
    KAZAR

    The Law Of Programming:

    As the Number of Lines of code increases, the number of bugs generated by fixing a bug increases exponentially.
    __________________________________
    www.startingqbasic.co.uk

  3. #3

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Windows Version Language

    Kazar.

    Thank you very much. this should work.

    ill check it and come back.

    Bye

  4. #4

    Thread Starter
    PowerPoster Fazi's Avatar
    Join Date
    Aug 2005
    Location
    Underworld
    Posts
    2,525

    Re: Windows Version Language

    Hai kazar.

    I works very well. thank you.

    let me rate your post..
    bye.
    faz.....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width