CTRL+ALT+DEL的控制和修改
问题描述:这是一个我网上找来的控制热键的例子,说是能控制CTRL+ALT+DEL、WIN、ALT+TAB等(其它有效,CTRL+ALT+DEL还是无法屏蔽,这也要屏蔽掉),现在要取消两个单选框,只剩下文本框和按钮,屏蔽热键要在打开这个程序时生效,(在Form_Load()时),不可限制字母键和数字键,在按取消键时屏蔽失效,请问怎么修改;图片截图在附件;
[B]Module1.bas代码如下;[/B]
Option Explicit
Private Sub chkDisable_Click()
If chkDisable = vbChecked Then
hhkLowLevelKybd = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf LowLevelKeyboardProc, App.hInstance, 0) '加载钩子
Else
UnhookWindowsHookEx hhkLowLevelKybd
hhkLowLevelKybd = 0
End If
End Sub
Private Sub chkDisableAll_Click()
If chkDisableAll = vbChecked Then
hhkLowLevelKybd = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf LowLevelKeyboardProc, App.hInstance, 0) '加载钩子
Text1.SetFocus
Else
UnhookWindowsHookEx hhkLowLevelKybd
hhkLowLevelKybd = 0
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
If hhkLowLevelKybd <> 0 Then UnhookWindowsHookEx hhkLowLevelKybd '卸载钩子
End Sub
[B]Form1代码如下;[/B]
Option Explicit
Private Sub chkDisable_Click()
If chkDisable = vbChecked Then
hhkLowLevelKybd = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf LowLevelKeyboardProc, App.hInstance, 0) '加载钩子
Else
UnhookWindowsHookEx hhkLowLevelKybd
hhkLowLevelKybd = 0
End If
End Sub
Private Sub chkDisableAll_Click()
If chkDisableAll = vbChecked Then
hhkLowLevelKybd = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf LowLevelKeyboardProc, App.hInstance, 0) '加载钩子
Text1.SetFocus
Else
UnhookWindowsHookEx hhkLowLevelKybd
hhkLowLevelKybd = 0
End If
End Sub
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Form_Unload(Cancel As Integer)
If hhkLowLevelKybd <> 0 Then UnhookWindowsHookEx hhkLowLevelKybd '卸载钩子
End Sub
有会修改的高手请帮忙