界面很简单,1个Text,1个Button
功能:点击Button,从你当前打开的所有窗口的中,获取aa.htm的内容。'按扭程序-------------------
Dim dWinFolder As New ShellWindows
Dim objDoc As Object
Dim objIE As Object
Dim StrUrl As String
ReadK = 0
StrUrl = "file:///C:/aa.htm"
For Each objIE In dWinFolder '循环Win中所有打开的窗口
If objIE.LocationURL = StrUrl Then
Set objDoc = objIE.Document.All("mayueframe")
For i = 1 To objDoc.All.length - 1 '循环当前窗口的所有数据
TextListData.Text = objDoc.Document.All(3).outerHTML
Exit For
End If
Next
Exit For
End If
Next'函数程序------------
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1Public Function PutWindowOnTop(pFrm As Form)
Dim lngWindowPosition As Long
lngWindowPosition = SetWindowPos(pFrm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Function现在该程序可以判断出所有打开的窗体,并从中把aa.htm内容放到text中,但问题是,aa.htm是框架网页,获取不了其中的内容。问题:如何获取aa.htm中的框架内容!!!
(我用了几次Document.kuangjia1.Document.body.innerHTML这样的方法都不行。希望大虾们测试下。谢谢~~~~~)
功能:点击Button,从你当前打开的所有窗口的中,获取aa.htm的内容。'按扭程序-------------------
Dim dWinFolder As New ShellWindows
Dim objDoc As Object
Dim objIE As Object
Dim StrUrl As String
ReadK = 0
StrUrl = "file:///C:/aa.htm"
For Each objIE In dWinFolder '循环Win中所有打开的窗口
If objIE.LocationURL = StrUrl Then
Set objDoc = objIE.Document.All("mayueframe")
For i = 1 To objDoc.All.length - 1 '循环当前窗口的所有数据
TextListData.Text = objDoc.Document.All(3).outerHTML
Exit For
End If
Next
Exit For
End If
Next'函数程序------------
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1Public Function PutWindowOnTop(pFrm As Form)
Dim lngWindowPosition As Long
lngWindowPosition = SetWindowPos(pFrm.hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE Or SWP_NOSIZE)
End Function现在该程序可以判断出所有打开的窗体,并从中把aa.htm内容放到text中,但问题是,aa.htm是框架网页,获取不了其中的内容。问题:如何获取aa.htm中的框架内容!!!
(我用了几次Document.kuangjia1.Document.body.innerHTML这样的方法都不行。希望大虾们测试下。谢谢~~~~~)
myhgyp(也许是这样的,信不信由你) 星(五角)
winehero(编程人生) 四角
faysky2() 三角
AndyFunction(开心) 二角
看来是想监视IE打开的某个页面。但这个页面是框架构造的,如果是如此,如果能得到这个框架所指向的页面的url的话,那就另外再用某个IE进程打开这个url地址一次,就可以获取详细内容了啊。
要的话给我Email:
[email protected]