标题:求助:这个句柄操作的错误在哪里。
只看楼主
xi213aaa
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-11-19
结帖率:50%
已结贴  问题点数:10 回复次数:1 
求助:这个句柄操作的错误在哪里。
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private 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 ,还是不行。
2016-03-24 10:52
hjxlj
Rank: 10Rank: 10Rank: 10
来 自:江西
等 级:贵宾
威 望:14
帖 子:292
专家分:1519
注 册:2013-6-25
得分:10 
楼主想实现什么功能,能否详细描述清楚

本人QQ:775420425
2016-03-26 16:15



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-462849-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.333167 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved