vb SendMessage 如何模拟键盘填写?
1个回答
展开全部
Private Const WM_SETTEXT = &HC
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub Command1_Click()
Dim w As Long
w = SendMessage(Text1.hwnd, WM_SETTEXT, ByVal 0&, ByVal "王小明")
If w = 0 Then
MsgBox "失败"
Else
MsgBox "成功"
End If
End Sub
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Sub Command1_Click()
Dim w As Long
w = SendMessage(Text1.hwnd, WM_SETTEXT, ByVal 0&, ByVal "王小明")
If w = 0 Then
MsgBox "失败"
Else
MsgBox "成功"
End If
End Sub
更多追问追答
追问
你这好像不是模拟解盘的。。 因为发送到里的和用解盘输入的不能激活某一项
追答
那是你的要求没说明白,算我没说
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询