Getting the IWebBrowser2 interface for each HTML frame
来源:互联网 发布:python 变量声明 编辑:程序博客网 时间:2024/05/14 14:23
http://www.mvps.org/emorcillo/en/code/vb6/wbframe.shtml
Getting the IWebBrowser2 interface for each HTML frame
This code enumerates the frames of a HTML page loaded in the WebBrowser control to get they IWebBrowser2 interface.
Note: This tip is based on the Microsoft KB article 196340 and requieres the OLELIB.TLB type library.
EnumFrames
Sub EnumFrames(ByVal wb As WebBrowser)
Dim pContainer As olelib.IOleContainer
Dim pEnumerator As olelib.IEnumUnknown
Dim pUnk As olelib.IUnknown
Dim pBrowser As SHDocVw.IWebBrowser2
Set pContainer = wb.Object.Document
' Get an enumerator for the frames
If pContainer.EnumObjects(OLECONTF_EMBEDDINGS, pEnumerator) = 0 Then
Set pContainer = Nothing
' Enumerate and refresh all the frames
Do While pEnumerator.Next(1, pUnk) = 0
On Error Resume Next
' Clear errors
Err.Clear
' Get the IWebBrowser2 interface
Set pBrowser = pUnk
If Err.Number = 0 Then
Debug.Print "Frame: " & pBrowser.LocationURL
End If
Loop
Set pEnumerator = Nothing
End If
End Sub
- Getting the IWebBrowser2 interface for each HTML frame
- Getting ready for the cloud
- The First (for-each ,Array)
- The first (for-each,数组)
- Show the implicit parameter for each instance.
- HTML CSS: the language of web-getting to know HTML
- 12 resources for getting a jump on HTML 5
- For the End User, the Interface Is the System
- PHP Tip: Getting the property count for an object
- Getting started with the MeeGo SDK for Linux
- Getting started with the MeeGo v1.2 SDK for Linux
- for each
- for each
- for each
- for each
- for each
- FOR EACH
- for-each
- 来自smth
- C++经典
- C#轻松解决世纪迷题
- 在 Visual Basic .NET 中创建控件数组
- 不能忘却的怀念
- Getting the IWebBrowser2 interface for each HTML frame
- CVS权限设置
- C#锐利体验
- VB6程序员:未来在哪里?(看破三个神话)
- 在无线J2ME设备上实现超文本传输协议
- 下雨了
- 海量数据库的查询优化及分页算法方案
- 推荐一些适合初学者的3D教程
- ASP.NET中的Http Handler