AllApi.net

[an error occurred while processing this directive]
 
Const KL_NAMELENGTH = 9
Const KT_TYPE = 0
Const KT_SUBTYPE = 1
Const KT_FUNCTIONKEYS = 2
Private Declare Function GetKeyboardLayoutName Lib "user32" Alias "GetKeyboardLayoutNameA" (ByVal pwszKLID As String) As Long
Private Declare Function GetKeyboardType Lib "user32" (ByVal nTypeFlag As Long) As Long
Private Sub Form_Paint()
    'KPD-Team 1999
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    Dim strName As String
    'Clear the form
    Me.Cls
    'Create a buffer
    strName = String(KL_NAMELENGTH, 0)
    'Get the keyboard layout name
    GetKeyboardLayoutName strName
    Me.Print "Keyboard layout name: " + strName
    Select Case GetKeyboardType(KT_TYPE)
        Case 1
            Me.Print "Keyboard type: IBM PC/XT or compatible (83-key) keyboard"
        Case 2
            Me.Print "Keyboard type: Olivetti “ICO” (102-key) keyboard"
        Case 3
            Me.Print "Keyboard type: IBM PC/AT (84-key) or similar keyboard"
        Case 4
            Me.Print "Keyboard type: IBM enhanced (101- or 102-key) keyboard"
        Case 5
            Me.Print "Keyboard type: Nokia 1050 and similar keyboards"
        Case 6
            Me.Print "Keyboard type: Nokia 9140 and similar keyboards"
        Case 7
            Me.Print "Keyboard type: Japanese keyboard"
        Case Else7
            Me.Print "Keyboard type: Unknown"
    End Select
    Select Case GetKeyboardType(KT_FUNCTIONKEYS)
        Case 1
            Me.Print "Number of function keys: 10"
        Case 2
            Me.Print "Number of function keys: 12 (sometimes 18)"
        Case 3
            Me.Print "Number of function keys: 10"
        Case 4
            Me.Print "Number of function keys: 12"
        Case 5
            Me.Print "Number of function keys: 10"
        Case 6
            Me.Print "Number of function keys: 24"
        Case 7
            Me.Print "Number of function keys: Hardware dependent and specified by the OEM"
        Case Else
            Me.Print "Number of function keys: Unknown"
    End Select
End Sub


 
Copyright © 1998-2000, The KPD-Team.
Send mail to KPDTeam@Allapi.net with comments about this web site.
This site is located at
http://www.Allapi.net/