Cush Posted April 19, 2006 Share Posted April 19, 2006 Hi, I'd like to list the current URLs of multiple explorer instances in a combo box, but I'm struggling to work out how to do it. Any help would be greatly appreciated. Thanks Cush Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted April 19, 2006 Moderators Share Posted April 19, 2006 Hi, I'd like to list the current URLs of multiple explorer instances in a combo box, but I'm struggling to work out how to do it. Any help would be greatly appreciated. Thanks CushYou should be able to modify this to do what you want. expandcollapse popup#include <IE.au3> #include <GUIConstants.au3> #Include <GuiCombo.au3> Opt('GUIOnEventMode', True) $Form1 = GUICreate("Link List", 351, 72, 192, 125) GUISetOnEvent($GUI_EVENT_CLOSE, 'Event_GUIClose') $Combo1 = GUICtrlCreateCombo("Select Link", 8, 8, 337, 21) $Button1 = GUICtrlCreateButton("Open", 144, 40, 75, 25) GUICtrlSetOnEvent(-1, 'OpenLink') ToolTip("Gathering Links" & @LF & @LF & "Please Wait...", @DesktopWidth / 2, @DesktopHeight / 2) $sLinks = "www.google.com,www.yahoo.com" $sLinks = StringSplit($sLinks, ",") For $i = 1 To UBound($sLinks) - 1 $oIE = _IECreate (0) _IENavigate ($oIE, $sLinks[$i]) $ohrefs = _IETagNameGetCollection ($oIE.document, "a") For $ohref In $ohrefs $shrefUrl = $ohref.GetAttribute ("HREF") If $shrefUrl == 0 Then ContinueLoop Else _GUICtrlComboAddString($Combo1, $shrefUrl) EndIf Next _IEQuit ($oIE) Sleep(500) Next ToolTip("") GUISetState(@SW_SHOW) While 1 Sleep(250) WEnd Func OpenLink() Local $stext, $iSelected $iSelected = _GUICtrlComboGetCurSel($Combo1) _GUICtrlComboGetLBText($Combo1, $iSelected, $stext) If $stext <> "Select Link" Then $oIE = _IECreate () _IENavigate ($oIE, $stext) Else MsgBox(48, "Error", "You must select a link.") EndIf EndFunc ;==>OpenLink Func Event_GUIClose() Exit EndFunc ;==>Event_GUIClose Link to comment Share on other sites More sharing options...
cdkid Posted April 19, 2006 Share Posted April 19, 2006 (edited) Hmm, let's see if this works $shell = ObjCreate("Shell.Application") dim $winsar[1], $count = 1 For $i in $shell.windows If (ObjName($i.document) = "DispHTMLDocument") Then ReDim $winsar[UBound($winsar, 1) + 1] $winsar[$count] = $i.locationurl $count = $count + 1 EndIf Next $winsar[0] = $count - 1 That should work... untested. just loop through the $winsar array to make your comboboxes. The previous one that I made wasn't working at all, so i tried this, and it works great ~cdkid Edited April 19, 2006 by cdkid AutoIt Console written in C#. Write au3 code right at the console :D_FileWriteToLineWrite to a specific line in a file.My UDF Libraries: MySQL UDF Library version 1.6 MySQL Database UDF's for AutoItI have stopped updating the MySQL thread above, all future updates will be on my SVN. The svn location is:kan2.sytes.net/publicsvn/mysqlnote: This will still be available, but due to my new job, and school hours, am no longer developing this udf.My business: www.hirethebrain.com Hire The Brain HireTheBrain.com Computer Consulting, Design, Assembly and RepairOh no! I've commited Scriptocide! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now