Simular NUM LOCK con API?
Publicado por Pablin (19 intervenciones) el 14/07/2005 22:25:27
yo encontre un ejemplo que es...
Const VK_NUMLOCK = &H9
Const KEYEVENTF_EXTENDEDKEY = &H1
Const KEYEVENTF_KEYUP = &H2
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
'Simular que pulsamos la tecla
keybd_event VK_NUMLOCK, 0, 0, 0
'Simular que soltamos la tecla
keybd_event VK_NUMLOCK, 0, KEYEVENTF_KEYUP, 0
y eso funciona para la tecla TAB, alguien sabe como hacer que funcione para la tecla NUMLOCK, CAPSLOCK Y SCROLL LOCK? o aunque sea para alguna de esas tres?
Muchas gracias por la ayuda.
Const VK_NUMLOCK = &H9
Const KEYEVENTF_EXTENDEDKEY = &H1
Const KEYEVENTF_KEYUP = &H2
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
'Simular que pulsamos la tecla
keybd_event VK_NUMLOCK, 0, 0, 0
'Simular que soltamos la tecla
keybd_event VK_NUMLOCK, 0, KEYEVENTF_KEYUP, 0
y eso funciona para la tecla TAB, alguien sabe como hacer que funcione para la tecla NUMLOCK, CAPSLOCK Y SCROLL LOCK? o aunque sea para alguna de esas tres?
Muchas gracias por la ayuda.
Valora esta pregunta


0