|
|
|
|
|
Dicas
|
|
Visual Basic (Mouse/Teclado)
|
|
|
Título da Dica: Alternando Caps e NumLock via código
|
|
|
|
Postada em 6/1/2003 por Spidey
Inserir dois commandbutton com nome cmdCapsLock e cmdNumLock:
Option Explicit Private Type KeyboardBytes kbByte(0 To 255) As Byte End Type Private kbArray As KeyboardBytes Private Declare Function GetKeyboardState Lib "User32" (kbArray As KeyboardBytes) As Long Private Declare Function SetKeyboardState Lib "User32" (kbArray As KeyboardBytes) As Long
Private Sub cmdCapsLock_Click() Call GetKeyboardState(kbArray) kbArray.kbByte(&H14) = IIf(kbArray.kbByte(&H14) = 1, 0, 1) Call SetKeyboardState(kbArray) End Sub
Private Sub cmdNumLock_Click() Call GetKeyboardState(kbArray) kbArray.kbByte(&H90) = IIf(kbArray.kbByte(&H90) = 1, 0, 1) Call SetKeyboardState(kbArray) End Sub
|
|
|
|
|