求助:这个句柄操作的错误在哪里。
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As LongPrivate Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
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 Const BM_CLICK = &HF5
Private Sub Command1_Click()
Shell (App.Path & "\迅雷精简版.exe")
'迅雷精简版 浏览(&B)...
Dim t As Long
Dim b As String
t = FindWindow(vbNullString, "迅雷精简版 ")
MsgBox (t)
b = FindWindowEx(t, 0, vbNullString, "安装(&I)")
MsgBox (b)
Dim send As Long
send = SendMessage(b, BM_CLICK, 0, 0)
End Sub
————————————————————————————————————
编写一个程序,实现软件自动无人安装,为什么t、b都有句柄值,最后一步sendmessage不能自动实现点击“下一步”呢?
PS:最后一步也尝试过直接SendMessage b, BM_CLICK, 0, 0 ,还是不行。