Sign in to follow this  
Followers 0
Shinies

AiEB

5 posts in this topic

#1 ·  Posted (edited)

Hey, i was inspired by trickytroy a long time ago when he posted his "Troyzilla" web browser. I decided to create a web browser completely from AutoIt and came up with AiEB(AutoitInternetExplorerBrowser). I lost interest in this project a while after starting it and am just now deciding to post it here incase u guys wanna take a peek :P . So here it is:

**I just want to stress that this was made when i was a beginner and is very buggy and NOT complete**

Opt( "TrayAutoPause", 0 )

;Includes
#include <GuiConstants.au3>
#include <GuiCombo.au3>
#include <INet.au3>
#Include <GuiList.au3>

;Tray Stuff
TraySetIcon( "Icon.ico" )

;Hotkeys
HotKeySet( "^o", "_Open" )
HotKeySet( "^s", "_Save" )
HotKeySet( "^!e", "_Exit" )
HotKeySet( "{Esc}", "_Stop" )
HotKeySet( "{f5}", "_Refresh" )
HotKeySet( "^+b", "_Back" )
HotKeySet( "^+f", "_Forward" )
HotKeySet( "^+a", "_Favs" )
HotKeySet( "^+h", "_Home" )
HotKeySet( "{f1}", "_Help" )
HotKeySet( "{f2}", "_About" )
HotKeySet( "{enter}", "_Go" )

;Varaiables
$HomePage = IniRead("Settings.ini", "Settings", "HomePage", "about:Blank")
$FavIni = IniRead("Settings.ini", "Favorites", "Favs", "")
If $FavIni = "|" Then
    IniWrite("Settings.ini", "Favorites", "Favs", "")
    EndIf


;The main Gui
$Browser = GuiCreate("AiEB v 1.00 - " & $HomePage, (@DesktopWidth-50), (@DesktopHeight-100),(@DesktopWidth-798)/2, (@DesktopHeight-546)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_MAXIMIZE)


;The Menubar
;File
$MenuFile = GUICtrlCreateMenu("&File")
$MenuFileOpen = GUICtrlCreateMenuitem("Open                                                        Ctrl+O", $MenuFile)
$MenuFileSave = GUICtrlCreateMenuitem("Save                                                        Ctrl+S", $MenuFile)
$MenuFileExit = GUICtrlCreateMenuitem("Exit                                                        Ctrl+Alt+E", $MenuFile)
;View
$MenuView = GUICtrlCreateMenu("&View")
$MenuViewStop = GUICtrlCreateMenuitem("Stop                                     Esc", $MenuView)
$MenuViewRefresh = GUICtrlCreateMenuitem("Refresh                                F5", $MenuView)
$MenuViewBack = GUICtrlCreateMenuitem("Back                                    Ctrl+Shift+B", $MenuView)
$MenuViewForward = GUICtrlCreateMenuitem("Forward                                Ctrl+Shift+F", $MenuView)
$MenuViewFavorites = GUICtrlCreateMenuitem("Favorites                              Ctrl+Shift+A", $MenuView)
$MenuViewHome = GUICtrlCreateMenuitem("Home                                   Ctrl+Shift+H", $MenuView)
;Settings
$MenuSettings = GUICtrlCreateMenu("&Settings")
$MenuSettingsViewSettings = GUICtrlCreateMenuitem("View Settings                                      ", $MenuSettings)
;Tools
$MenuTools = GUICtrlCreateMenu("&Tools")
$MenuToolsEncoder = GUICtrlCreateMenuitem("AiEB Encoder                                ", $MenuTools)
$MenuToolsViewSource = GUICtrlCreateMenuitem("View Source                                ", $MenuTools)
;Help
$MenuHelp = GUICtrlCreateMenu("&Help")
$MenuHelpAbout = GUICtrlCreateMenuitem("About AiEB                      F1", $MenuHelp)
$MenuHelpHelp = GUICtrlCreateMenuitem("AiEB Help                        F2", $MenuHelp)


;The window
$Logo = GUICtrlCreatePic("logo2.bmp", 2, 0, 140, 40)
$Adress = GUICtrlCreateCombo($HomePage, 145, 15, 553, 23)
GUICtrlSetFont(-1, 9, 400, 0, "Arial")
GUICtrlSetColor(-1, 0xFF0000)
GUICtrlSetTip(-1, "Type adress in here")
$Go = GUICtrlCreateButton("Go", 705, 5, 71, 43, $BS_BITMAP)
GUICtrlSetTip(-1, "Click to go to adress")
GUICtrlSetImage($Go, "gobutton.bmp")
$Back = GUICtrlCreateButton("Back", 8, 40, 86, 38, $BS_BITMAP)
GUICtrlSetImage($Back, "backbutton.bmp")
GUICtrlSetTip(-1, "Click to go back")
$Forward = GUICtrlCreateButton("Forward", 96, 40, 123, 39, $BS_BITMAP)
GUICtrlSetImage($Forward, "forwardbutton.bmp")
GUICtrlSetTip(-1, "Click to go forward")
$Stop = GUICtrlCreateButton("Stop", 221, 40, 86, 39, $BS_BITMAP)
GUICtrlSetTip(-1, "Click to stop loading")
GUICtrlSetImage($Stop, "stopbutton.bmp")
$Refresh = GUICtrlCreateButton("Refresh", 309, 40, 119, 39, $BS_BITMAP)
GUICtrlSetTip(-1, "Click to refresh page")
GUICtrlSetImage($Refresh, "refreshbutton.bmp")
$Home = GUICtrlCreateButton("Home", 430, 40, 91, 39, $BS_BITMAP)
GUICtrlSetTip(-1, "Click to go to homepage")
GUICtrlSetImage($Home, "homebutton.bmp")
$Favorites = GUICtrlCreateButton("Favorites", 523, 40, 132, 39, $BS_BITMAP)
GUICtrlSetImage($Favorites, "favoritesbutton.bmp")
GUICtrlSetTip(-1, "Click to see favorites")
GuiSetState()
$Site = GUICreate("", (@DesktopWidth-19), (@DesktopHeight-155), 9, 80, $WS_CHILD + $WS_BORDER, "", $Browser)
    GUISetState()
$dll = DllOpen("cwebpage.dll")
    DllCall($dll, "long", "EmbedBrowserObject", "hwnd", $Site)
    DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $Site, "str", $HomePage)

While 1
    $msg = GuiGetMsg()
    Select
        
    Case $msg = $GUI_EVENT_CLOSE
        Call( "_Exit")
    Case $msg = $MenuFileExit
        Call( "_Exit")
    Case $msg = $MenuFileOpen
        Call( "_Open")
    Case $msg = $MenuFileSave
        Call( "_Save")
    Case $msg = $MenuViewBack
        Call( "_Back")
    Case $msg = $MenuViewFavorites
        Call( "_Favs")
    Case $msg = $MenuViewForward
        Call( "_Forward")
    Case $msg = $MenuViewRefresh
        Call( "_Refresh")
    Case $msg = $MenuViewStop
        Call( "_Stop")
    Case $msg = $MenuViewHome
        Call( "_Home")
    Case $msg = $MenuHelpAbout
        Call( "_About")
    Case $msg = $MenuHelpHelp
        Call( "_Help")
    Case $msg = $MenuSettingsViewSettings
        Call( "_Settings")
    Case $msg = $MenuToolsEncoder
        Run( "Encoder.exe" )
    Case $msg = $MenuToolsViewSource
        Call( "_GetSource" )

    ;The actions
Case $msg = $Go
        Call( "_Go" )

    Case $msg = $Back
        Call( "_Back" )

    Case $msg = $Forward
        Call( "_Forward" )

    Case $msg = $Refresh
        Call( "_Refresh" )

    Case $msg = $Stop
        Call( "_Stop" )

    Case $msg = $Home
        Call( "_Home" )

    Case $msg = $Favorites
        Call( "_Favs" )
    
    EndSelect
WEnd
Exit

;=================================================================
;Exit Function - Exits
Func _Exit()
    If WinActive( "AiEB v 1.00 - " ) Then
    Exit
    Else
    EndIf
EndFunc

;=================================================================
;Go Function - Navigates to page in adress-bar
Func _Go()
        If WinActive( "AiEB v 1.00 - " ) Then
        DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $Site, "str", GUICtrlRead($Adress))
        WinSetTitle( "AiEB v 1.00 - ", "", "AiEB v 1.00 - " & GUICtrlRead($Adress))
    Else
    EndIf
    EndFunc

;=================================================================
;Stop Function - Stops page loading
Func _Stop()
        If WinActive( "AiEB v 1.00 - " ) Then
        DLLCall($dll,"none","DoPageAction","hwnd",$Site,"int", 5)
    Else
    EndIf
    EndFunc

;=================================================================
;Refresh Function - Refreshes page
Func _Refresh()
        If WinActive( "AiEB v 1.00 - " ) Then
        DLLCall($dll,"none","DoPageAction","hwnd",$Site,"int", 4)
    Else
    EndIf
    EndFunc


;=================================================================
;Home Function - Navigates to homepage
Func _Home()
        If WinActive( "AiEB v 1.00 - " ) Then
        $HomePage = IniRead("Settings.ini", "Settings", "HomePage", "about:Blank")
        GUICtrlSetData( $Adress , $HomePage)
        GUICtrlSetData( $Adress , $HomePage)
        DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $Site, "str", $HomePage)
        WinSetTitle( "AiEB v 1.00 - ", "", "AiEB v 1.00 - " & $HomePage)
    Else
    EndIf
    EndFunc

;=================================================================
;Back Function - Navigates back
Func _Back()
        If WinActive( "AiEB v 1.00 - " ) Then
        DLLCall($dll,"none","DoPageAction","hwnd",$Site,"int", 0)
    Else
    EndIf
    EndFunc

;=================================================================
;Forward Function - Navigates forward
Func _Forward()
        If WinActive( "AiEB v 1.00 - " ) Then
        DLLCall($dll,"none","DoPageAction","hwnd",$Site,"int", 1)
    Else
    EndIf
    EndFunc

;=================================================================
;The favorites screen (Buggy)
Func _Favs()
    ;The list Gui
    If WinActive( "AiEB v 1.00 - " ) Then
    $FavScreen = GUICreate("Favorites", 300, 375, 276, 141, "", "", $Browser)
    $FavList = GUICtrlCreateList("", 45, 50, 209, 250, -1, "")
    $FavIni = IniRead("Settings.ini", "Favorites", "Favs", "")
    If $FavIni = "|" Then
    IniWrite("Settings.ini", "Favorites", "Favs", "")
    EndIf
    GUICtrlSetData($FavList, $FavIni)
    GUICtrlSetFont($FavList, 11, 400, 0, "Arial")
    GUICtrlSetCursor ($FavList, 0)
    $FavAdd = GUICtrlCreateButton("Add", 55, 290, 81, 20)
    $FavDelete = GUICtrlCreateButton("Delete", 160, 290, 81, 20)
    $FavSelect = GUICtrlCreateButton("Select", 55, 320, 81, 20)
    $FavExit = GUICtrlCreateButton("Cancel", 160, 320, 81, 20)
    GUICtrlCreatePic("favs.bmp", 45, 5, 208, 40)
    GUISetState(@SW_SHOW)
    ;The Actions
    While 1
    GUICtrlSetTip($FavList, GUICtrlRead($FavList))
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
    GUIDelete($FavScreen)
    ExitLoop
    Case $msg = $FavExit
    GUIDelete($FavScreen)
    ExitLoop
    ;Loads the site you have selected
    Case $msg = $FavSelect
    GUICtrlSetData( $Adress, GUICtrlRead($FavList))
    GUICtrlSetData( $Adress, GUICtrlRead($FavList))
        DllCall($dll, "long", "DisplayHTMLPage", "hwnd", $Site, "str", GUICtrlRead($FavList))
        WinSetTitle( "AiEB v 1.00 - ", "", "AiEB v 1.00 - " & GUICtrlRead($FavList))
    GUIDelete($FavScreen)
    ExitLoop
    ;Adds a new favorite (A bit buggy still)
    Case $msg = $FavAdd
    $FavAddAdress = GUICreate("Favorites", 354, 90, 226, 234, $WS_POPUPWINDOW, "", $Browser)
    $FavAdress = GUICtrlCreateInput(GUICtrlRead($Adress), 40, 32, 257, 21, -1, $WS_EX_CLIENTEDGE)
    GUICtrlSetState($FavAdress, $GUI_FOCUS)
    $FavAddAdressOk = GUICtrlCreateButton("Ok", 40, 56, 81, 25, $BS_DEFPUSHBUTTON)
    $FavAddAdressCancel = GUICtrlCreateButton("Cancel", 216, 56, 81, 25)
    GUICtrlCreateLabel("Please enter the website adress here:", 40, 16, 181, 17)
    GUISetState(@SW_SHOW)
    While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        GUIDelete( $FavAddAdress )
        ExitLoop
        ;Adds the site typed in to your favs
    Case $msg = $FavAddAdressOk
        $FavIni = IniRead("Settings.ini", "Favorites", "Favs", "")
        If $FavIni = "|" Then
        IniWrite("Settings.ini", "Favorites", "Favs", "")
        EndIf
        $FavNewSite = GUICtrlRead($FavAdress)
        _GUICtrlListAddItem($FavList, $FavNewSite)
        IniWrite( "Settings.ini", "Favorites", "Favs", $FavIni & "|" & $FavNewSite)
        GUIDelete( $FavAddAdress )
        ExitLoop
    Case $msg = $FavAddAdressCancel
        
        GUIDelete( $FavAddAdress )
        ExitLoop
    EndSelect
WEnd
    Case $msg = $FavDelete
    $FavIni = IniRead("Settings.ini", "Favorites", "Favs", "")
    If $FavIni = "|" Then
    IniWrite("Settings.ini", "Favorites", "Favs", "")
    EndIf
    $FavNewList1 = StringReplace($FavIni, GUICtrlRead($FavList), "")
    $FavNewList2 = StringReplace($FavNewList1, "||", "|")
    IniWrite( "Settings.ini", "Favorites", "Favs", $FavNewList2)
    $FavStringToDel = _GUICtrlListFindString($FavList, GUICtrlRead($FavList))
    _GUICtrlListDeleteItem($FavList, $FavStringToDel)
EndSelect
WEnd
Else
EndIf
EndFunc

;=================================================================
;Open Function - Opens a file in the browser
Func _Open()
    If WinActive( "AiEB v 1.00 - " ) Then
    $FileToOpen = FileOpenDialog("File Open", @MyDocumentsDir, "Files (*.html;*.htm)|All Files (*.*)", 1 + 4 )
    If @error Then
    Else
    GUICtrlSetData( $Adress, $FileToOpen )
    GUICtrlSetData( $Adress, $FileToOpen )
    Call("_Go")
EndIf
EndIf
EndFunc

;=================================================================
;Save Function - Saves a file in the browser
Func _Save()

EndFunc

;=================================================================
;About Function - Shows the information of AiEB
Func _About()
If WinActive( "AiEB v 1.00 - " ) Then
$About = GUICreate("About AiEB", 323, 215, 228, 199, "", "", $Browser)
$AboutGroup = GUICtrlCreateGroup("", 8, 8, 305, 145)
$AboutLogo = GUICtrlCreatePic("logo2.bmp", 16, 24, 120, 48)
GUICtrlCreateLabel("AiEB Explorer", 152, 24, 68, 17)
GUICtrlCreateLabel("1.00", 152, 40, 25, 17)
GUICtrlCreateLabel("Copyright 2005-6 AiEB Explorer", 16, 128, 167, 17)
GUICtrlCreateLabel("AiEB stands for AutoIt Internet Explorer Browser. This software was created by Smirk_zero.", 16, 80, 150, 41)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$AboutOk = GUICtrlCreateButton("&OK", 120, 160, 75, 25)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        GUIDelete( $About )
        ExitLoop
    Case $msg = $AboutOk
        GUIDelete( $About )
        ExitLoop
    EndSelect
WEnd
Else
EndIf
EndFunc

;=================================================================
;Help Function - Opens the help file
Func _Help()
    If WinActive( "AiEB v 1.00 - " ) Then
    GUICtrlSetData( $Adress, "C:\My Documents\AutoIt v3\AiEB\Help.html" )
    GUICtrlSetData( $Adress, "C:\My Documents\AutoIt v3\AiEB\Help.html" )
    Call("_Go")
Else
EndIf
EndFunc

;=================================================================
;The Settings screen (Incomplete)
Func _Settings()
$Settings = GUICreate("Settings", 384, 400, 196, 117, $DS_SETFOREGROUND, "", $Browser)
$SettingsGroup1 = GUICtrlCreateGroup("Web Settings", 8, 56, 361, 89, $BS_CENTER)
$HomePage = IniRead("Settings.ini", "Settings", "HomePage", "about:Blank")
$SettingsHomePage = GUICtrlCreateInput($HomePage, 112, 72, 145, 21, -1, $WS_EX_CLIENTEDGE)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateLabel("Home Page:", 16, 72, 80, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
$SettingsHomePageNew = GUICtrlCreateButton("New", 264, 72, 49, 17)
$SettingsHomePageRestore = GUICtrlCreateButton("Restore", 320, 72, 41, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$SettingsGroup2 = GUICtrlCreateGroup("Customization", 8, 152, 361, 89, $BS_CENTER)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$SettingsGroup3 = GUICtrlCreateGroup("Browser Settings", 8, 248, 361, 89, $BS_CENTER)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$SettingsLogo = GUICtrlCreatePic("logo2.bmp", 8, 8, 104, 48)
$SettingsPic = GUICtrlCreatePic("settings.bmp", 136, 8, 208, 40)
$SettingsOk = GUICtrlCreateButton("Ok", 144, 344, 65, 25)
$SettingsCancel = GUICtrlCreateButton("Cancel", 224, 344, 65, 25)
$SettingsApply = GUICtrlCreateButton("Apply", 304, 344, 65, 25)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        GUIDelete( $Settings )
        ExitLoop
    Case $msg = $SettingsHomePageNew
        GUICtrlSetState($SettingsHomePage, $GUI_ENABLE)
        GUICtrlSetState($SettingsHomePage, $GUI_FOCUS)
    Case $msg = $SettingsHomePageRestore
        $SettingsHomePageRestoreHP = IniRead( "Settings.ini", "Settings", "HomePage", "about:Blank")
        GUICtrlSetData( $SettingsHomePage, $SettingsHomePageRestoreHP )
        GUICtrlSetState($SettingsHomePage, $GUI_DISABLE)
    Case $msg = $SettingsApply
        IniWrite( "Settings.ini", "Settings", "HomePage", GUICtrlRead($SettingsHomePage))
        GUICtrlSetState($SettingsHomePage, $GUI_DISABLE)
    Case $msg = $SettingsOk
        IniWrite( "Settings.ini", "Settings", "HomePage", GUICtrlRead($SettingsHomePage))
        GUIDelete( $Settings )
        ExitLoop
    Case $msg = $SettingsCancel
        GUIDelete( $Settings )
        ExitLoop
EndSelect
WEnd
EndFunc

;View Source Function - Works, but gets the url from the adressbar.
Func _GetSource()
    $PageSource = _INetGetSource("http://" & GUICtrlRead($Adress))
    ClipPut($PageSource)
    Run( "Notepad.exe" )
    WinWaitActive("Untitled - Notepad")
    ControlSetText( "Untitled - Notepad", "", 15, $PageSource )
    Sleep( 1000 )
    If $PageSource = "" Then
        ControlSetText( "Untitled - Notepad", "", 15, "If no source has been found, then it may be because the site doesnt exist, or because the adress in the adress bar has a 'Http//' at the begining.")
    EndIf
EndFunc

AiEB.rar

Edited by Smirk_zero

Share this post


Link to post
Share on other sites



Wow nice :D

Can i include this into my own script as an improve?

And if i include it does it work to with compiled downloader and explorer?

Regards


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites

Wow nice :D

Can i include this into my own script as an improve?

And if i include it does it work to with compiled downloader and explorer?

Regards

Please do. Dunno what ur talking about with the downloader and explorer.

Share this post


Link to post
Share on other sites

Ok :D thanks


--------------------------------------------------------------------------------------------------------------------------------Scripts : _Encrypt UDF_UniquePCCode UDF MS like calculatorInstall programm *UPDATED* --------------------------------------------------------------------------------------------------------------------------------[quote name='Helge' post='213117' date='Jul 26 2006, 10:22 AM']Have you ever tried surfing the internet with a milk-carton ?This is similar to what you're trying to do.[/quote]

Share this post


Link to post
Share on other sites

bump, nice script

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0