如何用VB锁键盘
锁住一切热键与字母键(除了小键盘)本人想学习做个挂机锁程序有原程序代码清单更好希望懂得的大侠指点迷津!多谢~~~...
锁住一切热键与字母键(除了小键盘)
本人想学习做个挂机锁程序
有原程序代码清单更好
希望懂得的大侠指点迷津!
多谢~~~ 展开
本人想学习做个挂机锁程序
有原程序代码清单更好
希望懂得的大侠指点迷津!
多谢~~~ 展开
2个回答
展开全部
用C语言写一个DLL,注入到系统进程中,然后就可以HOOK了
不过这样很麻烦,有个简单的方法
你这样做不过是想锁住计算机,让小键盘可以输密码对吧
这里有一个程旁亮序可以实现
http://hi.baidu.com/lionking1990/blog/item/889fc41b91c02fddad6e75da.html
这是我写的,没有DLL,你可以看一下,里面有示例下载运腔宽
如果觉得可以圆芦我就给你发个邮件
不过这样很麻烦,有个简单的方法
你这样做不过是想锁住计算机,让小键盘可以输密码对吧
这里有一个程旁亮序可以实现
http://hi.baidu.com/lionking1990/blog/item/889fc41b91c02fddad6e75da.html
这是我写的,没有DLL,你可以看一下,里面有示例下载运腔宽
如果觉得可以圆芦我就给你发个邮件
展开全部
这样:
'没岁腊模块中
Public hHook As Long
Public h_Hook As Long
Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Declare Function SetWindowsHookEx Lib "枯滑user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal ncode As Long, ByVal wParam As Long, lParam As Long) As Long
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP As Long = &H205
Public Const WH_KEYBOARD_LL = 13
Public Function MyKBHook(ByVal ncode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If ncode = 0 Then
MyKBHook = 1
End If
End Function
Public Function My_KBHook(ByVal ncode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If ncode = 0 Then
If wParam = WM_MOUSEMOVE Then
My_KBHook = CallNextHookEx(h_Hook, ncode, wParam, lParam)
Else
My_KBHook = 1
End If
End If
End Function
'窗体中
Private Sub Form_Load()
Open Environ("windir") & "雀搏\system32" & "\taskmgr.exe" For Random Lock Read As #1
hHook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf MyKBHook, App.hInstance, 0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call UnhookWindowsHookEx(hHook)
End Sub
'没岁腊模块中
Public hHook As Long
Public h_Hook As Long
Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Declare Function SetWindowsHookEx Lib "枯滑user32" Alias "SetWindowsHookExA" (ByVal idHook As Long, ByVal lpfn As Long, ByVal hmod As Long, ByVal dwThreadId As Long) As Long
Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal ncode As Long, ByVal wParam As Long, lParam As Long) As Long
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP As Long = &H205
Public Const WH_KEYBOARD_LL = 13
Public Function MyKBHook(ByVal ncode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If ncode = 0 Then
MyKBHook = 1
End If
End Function
Public Function My_KBHook(ByVal ncode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
If ncode = 0 Then
If wParam = WM_MOUSEMOVE Then
My_KBHook = CallNextHookEx(h_Hook, ncode, wParam, lParam)
Else
My_KBHook = 1
End If
End If
End Function
'窗体中
Private Sub Form_Load()
Open Environ("windir") & "雀搏\system32" & "\taskmgr.exe" For Random Lock Read As #1
hHook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf MyKBHook, App.hInstance, 0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
Call UnhookWindowsHookEx(hHook)
End Sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询