Constancia

VB_Detectar_Mayusculas

May 28th, 2013
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Private Const CapsLock As Long = &H14
  2. Private Declare Function EstadoDelTeclado Lib "User32" Alias "GetKeyboardState" (kState As Byte) As Long
  3.  
  4. Private Function BloqMay() As Boolean
  5.     Dim Estado As Long, Teclas(0 To 255) As Byte
  6.     Estado = EstadoDelTeclado(Teclas(0))
  7.     BloqMay = Teclas(CapsLock) = 1
  8. End Function
  9.  
  10. Sub Como_esta_BloqMay()
  11.     MsgBox "El estado de ""Bloq May"" es: " & _
  12.     IIf(BloqMay, "Activado", "Desactivado")
  13. End Sub
Advertisement
Add Comment
Please, Sign In to add comment