Toon posts:

Taal van OS terugvinden

Pagina: 1
Acties:

Verwijderd

Topicstarter
Ik moet voor een kleine applicatie eerst een controle van de taal van het besturingssysteem uitvoeren, zou mij iemand kunnen zeggen waar ik deze taal terug kan vinden?

In de registers? Is het bij elke windows versie hetzelfde? of moet ik ook eerst een OS controle doen?

  • Janoz
  • Registratie: Oktober 2000
  • Laatst online: 19-05 07:31

Janoz

Moderator Devschuur®

!litemod

In principe hoort daar gewoon een API call voor te zijn. Het lijkt me niet dat je hiervoor zelf in het register moet gaan zitten wroeten, daarmee omzeil je het hele nut van zo'n API ;). De bijbehorende call zal vast wel eergens in msdn te vinden zijn.

Ken Thompson's famous line from V6 UNIX is equaly applicable to this post:
'You are not expected to understand this'


  • RobIII
  • Registratie: December 2001
  • Niet online

RobIII

Admin Devschuur®

^ Romeinse Ⅲ ja!

(overleden)
API: GetLocaleInfo als ik me niet vergis

Disclaimer: *uit blote bolleke info*

[edit]
Jawohl ;)

Visual Basic:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Const LOCALE_USER_DEFAULT = &H400
Const LOCALE_SENGCOUNTRY = &H1002 ' English name of country
Const LOCALE_SENGLANGUAGE = &H1001  ' English name of language
Const LOCALE_SNATIVELANGNAME = &H4  ' native name of language
Const LOCALE_SNATIVECTRYNAME = &H8  ' native name of country
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()
    'KPD-Team 2001
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    MsgBox "You live in " & GetInfo(LOCALE_SENGCOUNTRY) & _
    " (" & GetInfo(LOCALE_SNATIVECTRYNAME) & ")," & vbCrLf & _
    "and you speak " & GetInfo(LOCALE_SENGLANGUAGE) & _
    " (" & GetInfo(LOCALE_SNATIVELANGNAME) & ").", vbInformation
End Sub
Public Function GetInfo(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))
    If Ret > 0 Then
        GetInfo = Left$(Buffer, Ret - 1)
    Else
        GetInfo = ""
    End If
End Function


(C) AllApi.net ;)

[ Voor 109% gewijzigd door RobIII op 10-10-2003 11:45 ]

There are only two hard problems in distributed systems: 2. Exactly-once delivery 1. Guaranteed order of messages 2. Exactly-once delivery.

Je eigen tweaker.me redirect

Over mij