#include <IE.au3>
#include <WinAPI.au3>
#include <GuiListView.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Dim $url=""
_IEErrorHandlerRegister()
Global $oIE = _IECreateEmbedded()
$Form1 = GUICreate("地址快速查询器", 492, 425, 200, 125)
$label1=GUICtrlCreateLabel("输入地址",20,28,50,24)
$urlinput=GUICtrlCreateInput("url地址",80,20,280,24)
$getbt=GUICtrlCreateButton("获取地址",370,20,100,24)
$L = GUICtrlCreateListView("序号|连接文字|地址", 8, 60, 457, 300,-1,BitOR($WS_EX_CLIENTEDGE,$LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT))
GUICtrlSendMsg($L, 0x101E, 0, 400)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 40)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 1, 200)
GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 2, 210)
$label2=GUICtrlCreateLabel("排除地址",20,375,50,24)
$urlinput2=GUICtrlCreateInput("要排除的url地址",80,370,280,24)
$getbt2=GUICtrlCreateButton("获取地址",370,370,100,24)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $getbt
_chage()
Case $getbt2
_Search(GUICtrlRead($urlinput2))
EndSwitch
WEnd
Func _Search($sText)
$iIndex = _GUICtrlListView_FindInText($L, $sText)
_GUICtrlListView_ClickItem($L, $iIndex)
EndFunc ;==>_Search
Func _chage()
$url = GUICtrlRead($urlinput)
GUICreate("mytest", 700, 600, (@DesktopWidth - 700) / 2, (@DesktopHeight - 600) / 2)
GUICtrlCreateObj($oIE, 0, 0, 700, 600)
GUISetState(@SW_MINIMIZE)
_IENavigate($oIE, $url)
$oLinks =_IELinkGetCollection ($oIE)
$iNumLinks = @extended
Dim $i=0
For $oLink In $oLinks
$ol=StringTrimRight($olink.href,1)
_GUICtrlListView_AddItem($L,$i, $i)
_GUICtrlListView_AddSubItem($L,$i,$ol, 2)
$sLinkText = _IEPropertyGet($oLink, "outerText")
_GUICtrlListView_AddSubItem($L,$i,$sLinkText, 1)
$i=$i+1
Next
EndFunc ;==>_chage