Jex Posted December 28, 2007 Share Posted December 28, 2007 (edited) I want share that script because will be useful for learn ie functions.That script not completed yet and have some bugs.Thanks danwilli for helps, he helped me too much for fix bugs and added history for back and forward buttons.expandcollapse popup#include <GUIConstants.au3> #include <GuiTab.au3> #include <IE.au3> #include <GuiStatusBar.au3> #include <array.au3> #include <Misc.au3> Global $Tab[11], $oIE[11], $Obj[11], $flasher[11], $backstack[11][2], $init = 1 Global $Title = "My Web Browser", $TabPos1 = 5, $TabPos2 = 35, $TabPos3 = 850, $TabPos4 = 650, $Status = 0, $Title2, $Status2 = "", $frskip = 0, $Count = 1, $HomePage, $LastPage _IEErrorHandlerRegister() $Form = GUICreate($Title, $TabPos3 + 10, $TabPos4 + 30) $FileMenu = GUICtrlCreateMenu("File") $FileOpenTab = GUICtrlCreateMenu("New Tab", $FileMenu) $OpenTab1 = GUICtrlCreateMenuItem("Open Blank Page", $FileOpenTab) $OpenTab2 = GUICtrlCreateMenuItem("Open Home Page", $FileOpenTab) $ShowSource = GUICtrlCreateMenuItem("Show Page Source", $FileMenu) $EditMenu = GUICtrlCreateMenu("Edit") $Cut = GUICtrlCreateMenuItem("Cut", $EditMenu) $Copy = GUICtrlCreateMenuItem("Copy", $EditMenu) $Paste = GUICtrlCreateMenuItem("Paste", $EditMenu) $Sep = GUICtrlCreateMenuItem("", $EditMenu) $Selectall = GUICtrlCreateMenuItem("Select All", $EditMenu) $SettingsMenu = GUICtrlCreateMenu("Settings") $ChangeHomePage = GUICtrlCreateMenuItem("Change Home Page", $SettingsMenu) $StatusBar = _GUICtrlStatusBar_Create($Form) Local $aParts[1] = [500] _GUICtrlStatusBar_SetParts($StatusBar, $aParts) $Input = GUICtrlCreateInput("", 7, 7, 305, 22) $Go = GUICtrlCreateButton("Go", 336, 5, 35, 25) $Back = GUICtrlCreateButton("Back", 376, 5, 43, 25) $Forward = GUICtrlCreateButton("Forward", 440, 5, 59, 25) $Stop = GUICtrlCreateButton("Stop", 520, 5, 43, 25) $Refresh = GUICtrlCreateButton("Refresh", 568, 5, 59, 25) $Home = GUICtrlCreateButton("Home", 632, 5, 43, 25) $Back2 = GUICtrlCreateButton("v", 418, 5, 17, 25) $Forward2 = GUICtrlCreateButton("v", 498, 5, 17, 25) $Go2 = GUICtrlCreateButton("v", 320, 5, 17, 25) $NewTab = GUICtrlCreateButton("New Tab", 680, 5, 65, 25) $Speak = GUICtrlCreateButton("Speak", 750, 5, 48, 25) $CloseTab = GUICtrlCreateButton("X", 832, 36, 19, 17) $CreateTab = GUICtrlCreateTab($TabPos1, $TabPos2, $TabPos3, $TabPos4 - 50) GUICtrlSetState($Back, $GUI_DISABLE) GUICtrlSetState($Forward, $GUI_DISABLE) GUICtrlSetState($Back2, $GUI_DISABLE) GUICtrlSetState($Forward2, $GUI_DISABLE) CheckPages() OpenTab(1, "Home") OpenTab(2, "http://www.yahoo.com") OpenTab(3, "Last") OpenTab(4, "http://www.autoitscript.com/forum/index.php") OpenTab(5) $init = 0 GUISetState() While 1 $Begin = TimerInit() $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $Go Navigate(GetTab(), GUICtrlRead($Input)) Case $Back HistoryBack(GetTab()) Case $Forward HistoryForward(GetTab()) Case $Stop _IEAction($oIE[GetTab()], "stop") Case $Refresh _IEAction($oIE[GetTab()], "refresh") Case $Home Navigate(GetTab(), "Home") Case $OpenTab1 OpenTab($Count) Case $OpenTab2 OpenTab($Count, "Home") Case $Cut _IEAction($oIE[GetTab()], "cut") Case $Copy _IEAction($oIE[GetTab()], "copy") Case $Paste _IEAction($oIE[GetTab()], "paste") Case $Selectall _IEAction($oIE[GetTab()], "selectall") Case $ChangeHomePage $hPage = InputBox("Home Page", "Set default home page :", $HomePage, "", 200, 130) If Not @error Then $HomePage = $hPage RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\My Web Browser", "Home Page", "REG_SZ", $HomePage) EndIf Case $NewTab OpenTab($Count, "Home") Case $ShowSource If FileExists(@TempDir & "\Source.txt") Then FileDelete(@TempDir & "\Source.txt") $Source = _IEDocReadHTML($oIE[GetTab()]) FileWrite(@TempDir & "\Source.txt", $Source) ShellExecute(@TempDir & "\Source.txt") Case $Speak $oSpeak = ObjCreate("Sapi.SpVoice") $oSpeak.Speak($oIE[GetTab()].document.selection.createRange.text) EndSwitch TestHistory(GetTab()) CheckStatusBar() NavigateCheck() CheckTitle() Sleep(10) WEnd Func CheckTitle() $CurrentTitle = _IEPropertyGet($oIE[GetTab()], "title") If $CurrentTitle <> $Title2 Then If $CurrentTitle = "" Then WinSetTitle($Form, "", $Title) Else WinSetTitle($Form, "", $CurrentTitle & " - " & $Title) EndIf $Title2 = $CurrentTitle EndIf $nLink = CheckLink() If $nLink <> "about:blank" And $nLink <> _GUICtrlTab_GetItemText($CreateTab, GetTab() - 1) Then GUICtrlSetData($Tab[GetTab()], $nLink) EndFunc ;==>CheckTitle Func CheckStatusBar() If _IEPropertyGet($oIE[GetTab()], "busy") And $Status2 <> _IEPropertyGet($oIE[GetTab()], "locationurl") Then _GUICtrlStatusBar_SetText($StatusBar, "Opening page " & _IEPropertyGet($oIE[GetTab()], "locationurl") & "...") GUICtrlSetState($Stop, $GUI_ENABLE) $Status2 = _IEPropertyGet($oIE[GetTab()], "locationurl") RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\My Web Browser", "Last Page", "REG_SZ", _IEPropertyGet($oIE[GetTab()], "locationurl")) ElseIf Not _IEPropertyGet($oIE[GetTab()], "busy") And $Status2 <> "" Then _GUICtrlStatusBar_SetText($StatusBar, " ") GUICtrlSetState($Stop, $GUI_DISABLE) $Status2 = "" EndIf EndFunc ;==>CheckStatusBar Func OpenTab($oNum, $oLink = "") If $Count > 10 Then MsgBox(0, "Error", "You may only have 10 tabs open at one time") Return @error EndIf $Count += 1 $backstack[$oNum][0] = 0 $Tab[$oNum] = GUICtrlCreateTabItem($oNum) $oIE[$oNum] = _IECreateEmbedded() $Obj[$oNum] = GUICtrlCreateObj($oIE[$oNum], $TabPos1 + 5, $TabPos2 + 25, $TabPos3 - 10, $TabPos4 - 80) $flasher[$oNum] = GUICtrlCreateEdit("", $TabPos1 + 5, $TabPos2 + 25, $TabPos3 - 10, $TabPos4 - 80) GUICtrlSetState($flasher[$oNum], $GUI_HIDE) Navigate($oNum, $oLink) TestHistory($oNum) If $init = 0 Then _GUICtrlTab_SetCurSel($CreateTab, $Count - 2) EndIf EndFunc ;==>OpenTab Func Navigate($nNum, $nLink) If $nLink = "" Then $nLink = "about:blank" _IENavigate($oIE[$nNum], $nLink, 0) GUICtrlSetData($Tab[$nNum], "Blank Page") Else If $nLink = "Home" Then $nLink = $HomePage ElseIf $nLink = "Last" Then $nLink = $LastPage EndIf _IENavigate($oIE[$nNum], $nLink, 0) $nLink = CheckLink($nLink) GUICtrlSetData($Tab[$nNum], $nLink) EndIf EndFunc ;==>Navigate Func CheckLink($cLink = "") If $cLink = "" Then $cLink = _IEPropertyGet($oIE[GetTab()], "locationurl") $cLink = StringReplace($cLink, "http://", "") $cLink = StringReplace($cLink, "www.", "") If StringInStr($cLink, "/") Then $cLink = StringSplit($cLink, "/") $cLink = $cLink[1] EndIf If StringLen($cLink) > 25 Then $cLink = StringLeft($cLink, 25) & "..." Return $cLink EndFunc ;==>CheckLink Func NavigateCheck() If _IsPressed("0D") And ControlGetFocus($Form) = "Edit1" Then Navigate(GetTab(), GUICtrlRead($Input)) GUICtrlSetState($Input, $GUI_FOCUS) EndIf EndFunc ;==>NavigateCheck Func CheckPages() $HomePage = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\My Web Browser", "Home Page") If @error Then $HomePage = "http://www.google.com" $LastPage = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\My Web Browser", "Last Page") If @error Then $LastPage = "http://www.autoitscript.com" EndFunc ;==>CheckPages Func GetTab() Return _GUICtrlTab_GetCurSel($CreateTab) + 1 EndFunc ;==>GetTab Func TestHistory($nNum) If IsArray($backstack) = 0 Then Return If $backstack[$nNum][0] = 0 Then If _IEPropertyGet($oIE[$nNum], "locationurl") <> "" Then $backstack[$nNum][0] += 1 $backstack[$nNum][$backstack[$nNum][0]] = _IEPropertyGet($oIE[$nNum], "locationurl") EndIf EndIf If $backstack[$nNum][$backstack[$nNum][0]] <> _IEPropertyGet($oIE[$nNum], "locationurl") And "" <> _IEPropertyGet($oIE[$nNum], "locationurl") And _IEPropertyGet($oIE[$nNum], "locationurl") <> $backstack[$nNum][$backstack[$nNum][0]] Then $backstack[$nNum][0] += 1 $newurl = _IEPropertyGet($oIE[$nNum], "locationurl") If $backstack[$nNum][0] + 1 > UBound($backstack, 2) Then ReDim $backstack[11][$backstack[$nNum][0] + 1] If $backstack[$nNum][$backstack[$nNum][0]] <> "" Then For $avar = $backstack[$nNum][0] To UBound($backstack, 2) - 1 $backstack[$nNum][$avar] = "" Next EndIf $backstack[$nNum][$backstack[$nNum][0]] = $newurl While _IEPropertyGet($oIE[$nNum], "locationurl") <> $backstack[$nNum][$backstack[$nNum][0]] Sleep(10) WEnd If $frskip = 0 Then FlashRefresh($nNum) Else $frskip = 0 EndIf EndIf NavButtons($nNum) EndFunc ;==>TestHistory Func NavButtons($nNum) If $backstack[$nNum][0] > 1 And GUICtrlGetState($Back) <> 80 Then GUICtrlSetState($Back, $GUI_ENABLE) GUICtrlSetState($Back2, $GUI_ENABLE) EndIf If $backstack[$nNum][0] = 1 And GUICtrlGetState($Back) <> 144 Then GUICtrlSetState($Back, $GUI_DISABLE) GUICtrlSetState($Back2, $GUI_DISABLE) EndIf If UBound($backstack, 2) - 1 > $backstack[$nNum][0] Then If $backstack[$nNum][$backstack[$nNum][0] + 1] = "" Then If GUICtrlGetState($Forward) <> 144 Then GUICtrlSetState($Forward, $GUI_DISABLE) GUICtrlSetState($Forward2, $GUI_DISABLE) EndIf Else If GUICtrlGetState($Forward) <> 80 Then GUICtrlSetState($Forward, $GUI_ENABLE) GUICtrlSetState($Forward2, $GUI_ENABLE) EndIf EndIf Else If GUICtrlGetState($Forward) <> 144 Then GUICtrlSetState($Forward, $GUI_DISABLE) GUICtrlSetState($Forward2, $GUI_DISABLE) EndIf EndIf EndFunc ;==>NavButtons Func HistoryBack($nNum) GUICtrlSetState($Back, $GUI_DISABLE) GUICtrlSetState($Back2, $GUI_DISABLE) $backstack[$nNum][0] -= 1 Navigate($nNum, $backstack[$nNum][$backstack[$nNum][0]]) While _IEPropertyGet($oIE[$nNum], "locationurl") <> $backstack[$nNum][$backstack[$nNum][0]] Sleep(10) WEnd $frskip = 1 TestHistory($nNum) FlashRefresh($nNum) EndFunc ;==>HistoryBack Func HistoryForward($nNum) GUICtrlSetState($Forward, $GUI_DISABLE) GUICtrlSetState($Forward2, $GUI_DISABLE) $backstack[$nNum][0] += 1 Navigate($nNum, $backstack[$nNum][$backstack[$nNum][0]]) While _IEPropertyGet($oIE[$nNum], "locationurl") <> $backstack[$nNum][$backstack[$nNum][0]] Sleep(10) WEnd $frskip = 1 TestHistory($nNum) FlashRefresh($nNum) EndFunc ;==>HistoryForward Func Test() _ArrayDisplay($backstack) EndFunc ;==>Test Func FlashRefresh($nNum) GUICtrlSetState($flasher[$nNum], $GUI_SHOW) GUICtrlSetState($flasher[$nNum], $GUI_HIDE) _GUICtrlTab_DeselectAll($CreateTab, False) EndFunc ;==>FlashRefresh Edited December 31, 2007 by Jex My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted December 29, 2007 Share Posted December 29, 2007 Looks good, add picture buttons, and should be has tabs Link to comment Share on other sites More sharing options...
Linux Posted December 29, 2007 Share Posted December 29, 2007 nice work! i'll save to future reference. You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!" Link to comment Share on other sites More sharing options...
Swift Posted December 29, 2007 Share Posted December 29, 2007 i luv it Link to comment Share on other sites More sharing options...
microsoft Posted December 29, 2007 Share Posted December 29, 2007 thanks , Error : On Line 26 StatusBar = _GUICtrlStatusBar_Create($Form) or Line 28 _GUICtrlStatusBar_SetParts($StatusBar, $aParts) Please Help > I am Use Autoit 3.2.8.1 Link to comment Share on other sites More sharing options...
Achilles Posted December 29, 2007 Share Posted December 29, 2007 Good work! I liked the status bar and the tabs... Resizeable would be nice.. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
NELyon Posted December 29, 2007 Share Posted December 29, 2007 (edited) Looks like we have both Microsoft AND Linux occupying this thread Aren't I just so funny?Looks nice though! I like the tabs. Also, check out shell32.dll for some nice icons instead of those text buttons. Edited December 29, 2007 by Senton-Bomb Link to comment Share on other sites More sharing options...
Swift Posted December 29, 2007 Share Posted December 29, 2007 man i luv this..i already deleted IE off meh computer... I LUV IT Link to comment Share on other sites More sharing options...
NELyon Posted December 29, 2007 Share Posted December 29, 2007 man i luv this..i already deleted IE off meh computer... I LUV IT Well, if you delete IE, the script won't work. It uses the Internet Explorer COM object to function.I only hope you deleted the shortcut and didn't uninstall IE, because half your PC would stop functioning. Link to comment Share on other sites More sharing options...
Achilles Posted December 29, 2007 Share Posted December 29, 2007 thanks ,Error : On Line 26 StatusBar = _GUICtrlStatusBar_Create($Form) or Line 28_GUICtrlStatusBar_SetParts($StatusBar, $aParts)Please Help >I am Use Autoit 3.2.8.1You need the latest version... 3.2.10.0 My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list] Link to comment Share on other sites More sharing options...
Swift Posted December 29, 2007 Share Posted December 29, 2007 my pc is functioning fine without IE...and it still works Link to comment Share on other sites More sharing options...
NELyon Posted December 29, 2007 Share Posted December 29, 2007 my pc is functioning fine without IE...and it still worksThen i assume you didn't fully uninstall it, just some of the visual aspects (Shortcuts, ect...) Link to comment Share on other sites More sharing options...
BananaFredSoft Posted December 29, 2007 Share Posted December 29, 2007 How do you even get IE off? Uninstalling it just reverts you back to a previous version. -ColinSite:www.bananafredsoft.comStuff:Simple Text Editor - MediaPlayer - Animator - BananaDB - BananaNotes - Chatta - Filesearch - Excuse GeneratorMy YouTube channel:http://www.youtube.com/user/colipat Link to comment Share on other sites More sharing options...
JustinReno Posted December 29, 2007 Share Posted December 29, 2007 IEEradicator. Link to comment Share on other sites More sharing options...
Jex Posted December 29, 2007 Author Share Posted December 29, 2007 Looks like we have both Microsoft AND Linux occupying this thread Aren't I just so funny?Looks nice though! I like the tabs. Also, check out shell32.dll for some nice icons instead of those text buttons.I'm checked shell32.dll but haven't ie back, forward, stop, refresh button icons in there. My scripts : Immediate Window , My Web Browser , Travian , Text Effect , Characters & Words per minute or second , Image Editor (ImageMagick) , Matrix style background effect ( Screensaver ) , Mail Sender , Protectlinks decoder and Rapidshare links checker , Fonts Fetcher , Region determine , Compare pictures , Gradient color box , Mouse Coordinates, Colors, Pixel Search things , Encrypt/Decrypt and embeding file in jpeg thing , Hard disk space monitor , Reflex game , Multiplayer Tic Tac Toe , WLM ( MSN ) personal message changer Link to comment Share on other sites More sharing options...
Gif Posted December 29, 2007 Share Posted December 29, 2007 my pc is functioning fine without IE...and it still worksthen probably IE ActiveX remained ( HKEY_CLASSES_ROOT\CLSID\{0002DF01-0000-0000-C000-000000000046} ) Link to comment Share on other sites More sharing options...
icadea Posted December 30, 2007 Share Posted December 30, 2007 this is a great addition. simply great. Now i'll could use this browser to automate IE functions. I'll keep your credit and name intact. Do let me know if this is ok. thanks again Link to comment Share on other sites More sharing options...
DirtDBaK Posted December 31, 2007 Share Posted December 31, 2007 lots of noobs invading the forum... shame... Anyway I'll test out your browser looks good need some skins you know throw in some color and some image buttons... [center][/center] Link to comment Share on other sites More sharing options...
Roofel Posted January 2, 2008 Share Posted January 2, 2008 Troubleshooting:) $CloseTab = Has none function:) Does nothing when clicked meaning filled browser with tabs:) Will do more tomorrow:) Never argue with an idiot, he will just bring you down to his own level and beat you with experience! :D Link to comment Share on other sites More sharing options...
crzftx Posted January 2, 2008 Share Posted January 2, 2008 (edited) cannot close tabs cannot resize pressing "enter" after typing in a new web address seems to simply refresh the current page the first page doesn't display correctly until I change tabs the down arrows don't do anything can't side scroll (with wheel) doesn't remember passwords -just some possibilities to think about Edited January 2, 2008 by crzftx 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