VBA Tips - Desabilitando o [CTRL] + [ALT] + [DEL]

Termo de Responsabilidade

Como posso impedir que a combinação de teclas [CTRL] + [ALT] + [DEL] estejam ativas enquanto minhas aplicações rodam? 

No evento ao carregar do seu formulário inicial cole:


Call DesativaCtrlAltDel

Cole o código abaixo em um novo módulo:  



Public Declare Function GetCurrentProcessId _ Lib "kernel32" () As Long

Public Declare Function GetCurrentProcess _ Lib "kernel32" () As Long 

Public Declare Function RegisterServiceProcess _ Lib "kernel32" (ByVal dwProcessID As Long, _ ByVal dwType As Long) As Long 

Public Const RSP_SIMPLE_SERVICE = 1 

Public Const RSP_UNREGISTER_SERVICE = 0 



Public Sub DesativaCtrlAltDel() 

Dim pid As Long, reserv As Long 



Let pid = GetCurrentProcessId() 

Let reserv = RegisterServiceProcess (pid, RSP_SIMPLE_SERVICE) 

End Sub 



References:

Tags: VBA, Tips, [CTRL] + [ALT] + [DEL], key, stop






Nenhum comentário:

Postar um comentário

diHITT - Notícias