VB如何获取一个软件的Internet Explorer_Server的句柄
我试过用FindWindowEx获取但是不行,好像Enumchilewindows和Getwindowsclass能找出他的句柄高手能不能帮忙给我举个例子! VB Internet Explorer 句柄 --------------------编程问答-------------------- 这是要做什么用? --------------------编程问答-------------------- 搞这种东西你的方式不对,建议你了解一下BHO技术,你可以百度一下“vb bho” --------------------编程问答-------------------- 用FindWindowEx应该可以的,全用FINDWINDOWEX(HWND,HWND1,VBNULLSTRING,VBNULLSTRING)
有时你指定类还不行,全用NULL反倒行,再按所得到的所有HWND,得到其CLASS,进行比较 --------------------编程问答-------------------- 我就是用这个方式处理的
'┏〓〓〓〓〓〓〓〓〓 FindHwndByClassAndId,start 〓〓〓〓〓〓〓〓〓┓--------------------编程问答-------------------- 根据类名 Internet Explorer_Server 进行查找 --------------------编程问答-------------------- 我获取好几个子窗口的子窗口的句柄获取了Internet Explorer_Server的句柄,就是不知如何让Internet Explorer_Server重新定向浏览其他网页 --------------------编程问答-------------------- 根据这个句柄不行的吧。 --------------------编程问答-------------------- http://bbs.csdn.net/topics/390540874?page=1#post-395251637
'[简介]:
'查找窗体中多层次下第几个相同类的句柄
Function FindHwndByClassAndId(WinHwnd As Long, ByVal Class As String, Optional FindId As Integer, Optional Id As Integer) As Long
'[mycode_id:1934],edittime:2011/8/3 3:30:07
Dim Hwnd2 As Long
Dim FindHwnd As Long, TempFindHwnd As Long
Hwnd2 = GetWindow(WinHwnd, GW_CHILD)
While FindHwnd = 0 And Hwnd2 > 0
If GetClass(Hwnd2) = Class Then
TempFindHwnd = Hwnd2
If Id = FindId Then
FindHwnd = TempFindHwnd
GoTo DoEnd
Else
Id = Id + 1
End If
End If
FindHwnd = FindHwndByClassAndId(Hwnd2, Class, FindId, Id)
Hwnd2 = GetWindow(Hwnd2, GW_HWNDNEXT)
Wend
DoEnd:
FindHwndByClassAndId = FindHwnd
End Function
'┗〓〓〓〓〓〓〓〓〓 FindHwndByClassAndId,end 〓〓〓〓〓〓〓〓〓┛
给分吧 --------------------编程问答--------------------
http://bbs.csdn.net/topics/390540874?page=1#post-395251637
给分吧
另外贡献个使用我之前的clsWindows框架的方法,很简便:
Dim w As New clsWindow
If w.GetWindowHwndByTitleEx("应用程序标题栏文字") > 0 Then
MsgBox w.GetElementHwndByClassName("Internet Explorer_Server") '得到ie控件句柄
End If
补充:VB , API