唉,找了半天,研究了半天还是没有弄出来。例子能读出所有的网址,哪一个是当前正打开的网址的啊?想做个一 ...
ahphsautoit 发表于 2012-4-8 11:44 #include <IE.au3>
$a = _GetActiveURL()
MsgBox(0, $a[0], $a[1])
Func _GetActiveURL()
;afan提示: 获取当前Ie窗口URL及标题
Local $hWin = WinActivate('[CLASS:IEFrame]')
Local $oIE = _IEAttach($hWin, 'Embedded', 1)
If @error = $_IEStatus_NoMatch Or Not IsObj($oIE) Then Return SetError(1, '', '')
$url = _IEPropertyGet($oIE, 'locationurl')
If $url = '' Then Return SetError(2, '', '')
Local $a[2] = [$url, _IEPropertyGet($oIE, 'title')]
Return $a
EndFunc ;==>_GetActiveURL
|