Zjištění typu klávesnice

Postup:
Založte nový projekt. Ve formuláři deklarujte:

Declare Function GetKeyboardType Lib "user32" (ByVal nTypeFlag As Long) As Long

Na formulář přidejte tlačítko a label. Na událost Click tlačítka:

Private Sub Command1_Click()
    Dim t As String
    Dim k As Long
    k = GetKeyboardType(0)
    If k = 1 Then t = "PC nebo kompatibilní 83-klávesová klávesnice"
    If k = 2 Then t = "102-klávesová klávesnice Olivetti"
    If k = 3 Then t = "AT nebo kompatibilní 84-klávesová klávesnice"
    If k = 4 Then t = "101-102-klávesová klávesnice"
    If k = 5 Then t = "Klávesnice Nokia 1050"
    If k = 6 Then t = "KLávesnice Nokia 9140"
    If k = 7 Then t = "Japonská klávesnice"
    label1.caption = "Typ klávesnice: " & t
End Sub

Zpět

Autor: The Bozena