原帖由 stjie 于 2008-10-24 13:32 发表
#include
$oIE = _IEAttach ("AutoIt")
MsgBox(0, "The URL", _IEPropertyGet ($oIE, "locationurl"))
谢谢楼上的提点。找到帮助里的示例,但似乎没找着可以罗列出当前打开所有IE窗口的地址
需要罗列出当前打开所有IE窗口的地址, 那就需要获得全部IE窗口的句柄, 试试下面代码:
#include <IE.au3>
#include <Array.au3>
AutoItSetOption("WinTitleMatchMode", 4)
Dim $aWinList, $oIE
$aWinList=WinList("classname=IEFrame");
If $aWinList[0][0]>0 Then
For $i=1 To $aWinList[0][0]
$oIE = _IEAttach($aWinList[$i][1],"HWND");
MsgBox(0, "The URL", _IEPropertyGet ($oIE, "locationurl"));
Next
Else
MsgBox(0, "Error", "No IE has been executed")
EndIf |