PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 25 → WD - Como ativar NumLock ou Casplock?
WD - Como ativar NumLock ou Casplock?
Iniciado por BOLLER ADRIANO, 29,jun. 2016 01:42 - No hay respuesta
Miembro registrado
3.660 mensajes
Popularité : +175 (223 votes)
Publicado el 29,junio 2016 - 01:42
//L`exemple est fait avec NUMLOCK

VK_NUMLOCK est un entier long = 0x90
VK_CAPITAL est un entier long = 0x14

// Récupération de l`état de NUMLOCK
SI AppelDLL32("user32","GetKeyState",VK_NUMLOCK) ALORS
Trace("NUMLOCK actif")
SINON
Trace("NUMLOCK inactif")
FIN

// Les deux lignes sont nécessaires
AppelDLL32("user32","keybd_event",VK_NUMLOCK,0,KEYEVENTF_EXTENDEDKEY+0,0)
AppelDLL32("user32","keybd_event",VK_NUMLOCK,0,KEYEVENTF_EXTENDEDKEY+KEYEVENTF_KEYUP,0)

// Laisser le temps à Windows de modifier l`état de la touche avant de la tester
Multitâche()

// Récupération de l`état de NUMLOCK
SI AppelDLL32("user32","GetKeyState",VK_NUMLOCK) ALORS
Trace("NUMLOCK actif")
SINON
Trace("NUMLOCK inactif")
FIN


--
Adriano José Boller
______________________________________________
Consultor e Representante Oficial da
PcSoft no Brasil
+55 (41) 9949 1800
adrianoboller@gmail.com
skype: adrianoboller
http://wxinformatica.com.br/