如何用VB锁键盘

锁住一切热键与字母键(除了小键盘)本人想学习做个挂机锁程序有原程序代码清单更好希望懂得的大侠指点迷津!多谢~~~... 锁住一切热键与字母键(除了小键盘)
本人想学习做个挂机锁程序

有原程序代码清单更好
希望懂得的大侠指点迷津!
多谢~~~
展开
 我来答
仁昊伟柏微
游戏玩家

2019-08-03 · 游戏我都懂点儿,问我就对了
知道大有可为答主
回答量:1.1万
采纳率:30%
帮助的人:866万
展开全部
用C语言写一个DLL,注入到系统进程中,然后就可以HOOK了
不过这样很麻烦,有个简单的方法
你这样做不过是想锁住计算机,让小键盘可以输密码对吧
这里有一个程旁亮序可以实现
http://hi.baidu.com/lionking1990/blog/item/889fc41b91c02fddad6e75da.html
这是我写的,没有DLL,你可以看一下,里面有示例下载运腔宽
如果觉得可以圆芦我就给你发个邮件
gujin170
2009-03-25 · TA获得超过937个赞
知道小有建树答主
回答量:1030
采纳率:66%
帮助的人:342万
展开全部
这样:

'没岁腊模块中
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
本回答被提问者采纳
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式