Strona: [  << <   1   > >>  ]  z  1     
Autor Temat: Wersja językowa Windows!
Viper87



Typ: neutral
Postów: 490
Zarejestrowany: Oct 2002
Wersja językowa Windows!

Witam!

Mam proste pytanie-potrzebuję odczytać wersję językową Windows. Podejrzewam, że służy do tego jakaś funkcja API, ale jak na złość nic w API Guide nie mogę wyszukać .


_____________________________________________
Viper

"Savoir c`est prevoir, prevoir c`est prevenir". 
(Wiedzieć to przewidzieć, przewidzieć to zapobiegać) 


29-11-2004 14:00
Pokaż profil Viper87  Wyślij email do Viper87   Odwiedź stronę Viper87  
DJK



Typ: neutral
Postów: 871
Zarejestrowany: Feb 2004

Private Declare Function GetSystemDefaultLangID Lib "kernel32" () As Integer

Private Function GetLanguage() As String
    Select Case GetSystemDefaultLangID()
    Case &H0: GetLanguage = "Language Neutral"
    Case &H400: GetLanguage = "Process Default Language"
    Case &H401: GetLanguage = "Arabic (Saudi Arabia)"
    Case &H801: GetLanguage = "Arabic(Iraq)"
    Case &HC01: GetLanguage = "Arabic(Egypt)"
    Case &H1001: GetLanguage = "Arabic(Libya)"
    Case &H1401: GetLanguage = "Arabic(Algeria)"
    Case &H1801: GetLanguage = "Arabic(Morocco)"
    Case &H1C01: GetLanguage = "Arabic(Tunisia)"
    Case &H2001: GetLanguage = "Arabic(Oman)"
    Case &H2401: GetLanguage = "Arabic(Yemen)"
    Case &H2801: GetLanguage = "Arabic(Syria)"
    Case &H2C01: GetLanguage = "Arabic(Jordan)"
    Case &H3001: GetLanguage = "Arabic(Lebanon)"
    Case &H3401: GetLanguage = "Arabic(Kuwait)"
    Case &H3801: GetLanguage = "Arabic (U.A.E.)"
    Case &H3C01: GetLanguage = "Arabic(Bahrain)"
    Case &H4001: GetLanguage = "Arabic(Qatar)"
    Case &H402: GetLanguage = "Bulgarian"
    Case &H403: GetLanguage = "Catalan"
    Case &H404: GetLanguage = "Chinese (Taiwan Region)"
    Case &H804: GetLanguage = "Chinese(PRC)"
    Case &HC04: GetLanguage = "Chinese (Hong Kong SAR, PRC)"
    Case &H1004: GetLanguage = "Chinese(Singapore)"
    Case &H405: GetLanguage = "Czech"
    Case &H406: GetLanguage = "Danish"
    Case &H407: GetLanguage = "German(Standard)"
    Case &H807: GetLanguage = "German(Swiss)"
    Case &HC07: GetLanguage = "German(Austrian)"
    Case &H1007: GetLanguage = "German(Luxembourg)"
    Case &H1407: GetLanguage = "German(Liechtenstein)"
    Case &H408: GetLanguage = "Greek"
    Case &H409: GetLanguage = "English (United States)"
    Case &H809: GetLanguage = "English (United Kingdom)"
    Case &HC09: GetLanguage = "English(Australian)"
    Case &H1009: GetLanguage = "English(Canadian)"
    Case &H1409: GetLanguage = "English(New Zealand)"
    Case &H1809: GetLanguage = "English(Ireland)"
    Case &H1C09: GetLanguage = "English (South Africa)"
    Case &H2009: GetLanguage = "English(Jamaica)"
    Case &H2409: GetLanguage = "English(Caribbean)"
    Case &H2809: GetLanguage = "English(Belize)"
    Case &H2C09: GetLanguage = "English(Trinidad)"
    Case &H40A: GetLanguage = "Spanish (Traditional Sort)"
    Case &H80A: GetLanguage = "Spanish(Mexican)"
    Case &HC0A: GetLanguage = "Spanish (Modern Sort)"
    Case &H100A: GetLanguage = "Spanish(Guatemala)"
    Case &H140A: GetLanguage = "Spanish (Costa Rica)"
    Case &H180A: GetLanguage = "Spanish(Panama)"
    Case &H1C0A: GetLanguage = "Spanish (Dominican Republic)"
    Case &H200A: GetLanguage = "Spanish(Venezuela)"
    Case &H240A: GetLanguage = "Spanish(Colombia)"
    Case &H280A: GetLanguage = "Spanish(Peru)"
    Case &H2C0A: GetLanguage = "Spanish(Argentina)"
    Case &H300A: GetLanguage = "Spanish(Ecuador)"
    Case &H340A: GetLanguage = "Spanish(Chile)"
    Case &H380A: GetLanguage = "Spanish(Uruguay)"
    Case &H3C0A: GetLanguage = "Spanish(Paraguay)"
    Case &H400A: GetLanguage = "Spanish(Bolivia)"
    Case &H440A: GetLanguage = "Spanish (El Salvador)"
    Case &H480A: GetLanguage = "Spanish(Honduras)"
    Case &H4C0A: GetLanguage = "Spanish(Nicaragua)"
    Case &H500A: GetLanguage = "Spanish (Puerto Rico)"
    Case &H40B: GetLanguage = "Finnish"
    Case &H40C: GetLanguage = "French(Standard)"
    Case &H80C: GetLanguage = "French(Belgian)"
    Case &HC0C: GetLanguage = "French(Canadian)"
    Case &H100C: GetLanguage = "French(Swiss)"
    Case &H140C: GetLanguage = "French(Luxembourg)"
    Case &H40D: GetLanguage = "Hebrew"
    Case &H40E: GetLanguage = "Hungarian"
    Case &H40F: GetLanguage = "Icelandic"
    Case &H410: GetLanguage = "Italian(Standard)"
    Case &H810: GetLanguage = "Italian(Swiss)"
    Case &H411: GetLanguage = "Japanese"
    Case &H412: GetLanguage = "Korean"
    Case &H812: GetLanguage = "Korean(Johab)"
    Case &H413: GetLanguage = "Dutch(Standard)"
    Case &H813: GetLanguage = "Dutch(Belgian)"
    Case &H414: GetLanguage = "Norwegian(Bokmal)"
    Case &H814: GetLanguage = "Norwegian(Nynorsk)"
    Case &H415: GetLanguage = "Polish"
    Case &H416: GetLanguage = "Portuguese(Brazilian)"
    Case &H816: GetLanguage = "Portuguese(Standard)"
    Case &H418: GetLanguage = "Romanian"
    Case &H419: GetLanguage = "Russian"
    Case &H41A: GetLanguage = "Croatian"
    Case &H81A: GetLanguage = "Serbian(Latin)"
    Case &HC1A: GetLanguage = "Serbian(Cyrillic)"
    Case &H41B: GetLanguage = "Slovak"
    Case &H41C: GetLanguage = "Albanian"
    Case &H41D: GetLanguage = "Swedish"
    Case &H81D: GetLanguage = "Swedish(Finland)"
    Case &H41E: GetLanguage = "Thai"
    Case &H41F: GetLanguage = "Turkish"
    Case &H421: GetLanguage = "Indonesian"
    Case &H422: GetLanguage = "Ukrainian"
    Case &H423: GetLanguage = "Belarusian"
    Case &H424: GetLanguage = "Slovenian"
    Case &H425: GetLanguage = "Estonian"
    Case &H426: GetLanguage = "Latvian"
    Case &H427: GetLanguage = "Lithuanian"
    Case &H429: GetLanguage = "Farsi"
    Case &H42A: GetLanguage = "Vietnamese"
    Case &H42D: GetLanguage = "Basque"
    Case &H436: GetLanguage = "Afrikaans"
    Case &H438: GetLanguage = "Faeroese"
    End Select
End Function

Pozdrawiam


_____________________________________________
Jeśli można coś zrobić w sposób optymalny to czemu nie

29-11-2004 14:32
Pokaż profil DJK  Wyślij email do DJK   Odwiedź stronę DJK  
marcin_an
Forumowicz




Typ: neutral
Postów: 1265
Zarejestrowany: Mar 2004

Może cię to zainteresuje:
Istnieje także funkcja GetUserDefaultLangID, która zwraca język wybrany przez użytkownika.


_____________________________________________
Jedzonko dla Google'a:
Forum na temat Visual Basic, C, C++, Pascal, Programowanie, API, PHP, VBA, VB.NET, QBasic, VBScript, Komputery
Moja strona o wszystkim

29-11-2004 18:28
Pokaż profil marcin_an  Wyślij email do marcin_an   Odwiedź stronę marcin_an  
DJK



Typ: neutral
Postów: 871
Zarejestrowany: Feb 2004

Zamiast używać Case i tylu linijek kodu może użyć tego:

Public Function GetSystemLang() As String
Dim Buffer As String
Dim ID As Integer
Buffer = String(255, Chr$(0))

ID = GetSystemDefaultLangID()
VerLanguageName ID, Buffer, Len(Buffer)
GetSystemLang = Left$(Buffer, InStr(1, Buffer, Chr$(0)) - 1)
End Function


Pozdrawiam


_____________________________________________
Jeśli można coś zrobić w sposób optymalny to czemu nie

05-12-2004 20:33
Pokaż profil DJK  Wyślij email do DJK   Odwiedź stronę DJK  
Wszystkich odpowiedzi: 3 :: Maxymalnie na stronę: 20
Strona: [  << <   1   > >>  ]  z  1