Jump to content
Sign in to follow this  
farhan879

NetZilla 1.0

Recommended Posts

farhan879

Hi, i've made a web browser. It pretty simple and basic. It crashes if it has to loads to much.

NetZilla.zip

Edit: Source released. :mellow:

#Include <INet.au3>
#Include <String.au3>

Global $oIE = ObjCreate("Shell.Explorer.2")
Global $ini = @ScriptDir & "\swb.ini"

Global $read_height = IniRead($ini, "Display", "Height", "")
Global $read_width = IniRead($ini, "Display", "Width", "")
Global $read_homepage = IniRead($ini, "Settings", "Homepage", "")
Global $read_starthomepage = IniRead($ini, "Settings", "StartHomepage", "")

If $read_height = "" Then
    IniWrite($ini, "Display", "Height", "600")
    IniWrite($ini, "Display", "Width", "800")
    $read_height = 600
    $read_width = 800
EndIf

If $read_starthomepage = "" Then
    $read_starthomepage = "1"
    $read_homepage = "www.autoitscript.com/forum"
EndIf

$iniread = IniRead($ini, "URL", "LAST URL", " ")
If $read_starthomepage = "0" Then $read_homepage = $iniread


$gui_main = GUICreate("", $read_width, $read_height + 20, -1, -1, 0x04000000 + 0x00CF0000)

$file_menu = GUICtrlCreateMenu("File")
$fm_newwind = GUICtrlCreateMenuItem("New Window", $file_menu)
$fm_sep = GUICtrlCreateMenuItem("", $file_menu)
$fm_open = GUICtrlCreateMenuItem("Open", $file_menu)
$fm_sep = GUICtrlCreateMenuItem("", $file_menu)
$fm_print = GUICtrlCreateMenuItem("Print", $file_menu)
$fm_sep = GUICtrlCreateMenuItem("", $file_menu)
$fm_savas = GUICtrlCreateMenuItem("Save As", $file_menu)
$fm_SaveSource = GUICtrlCreateMenuItem("Save Source", $file_menu)
$fm_sep = GUICtrlCreateMenuItem("", $file_menu)
$fm_exit = GUICtrlCreateMenuItem("Exit", $file_menu)

$view_menu = GUICtrlCreateMenu("View")
$vm_status = GUICtrlCreateMenuItem("Status Bar", $view_menu)
GUICtrlSetState(-1, 1)

$tool_menu = GUICtrlCreateMenu("Tools")
$tm_pref = GUICtrlCreateMenuItem("Preferences", $tool_menu)
$tm_sep = GUICtrlCreateMenuItem("", $tool_menu)

$tm_sep = GUICtrlCreateMenuItem("", $tool_menu)
$tm_gu = GUICtrlCreateMenuItem("Get Current URL", $tool_menu)

$about_menu = GUICtrlCreateMenu("About")
$am_about = GUICtrlCreateMenuItem("About", $about_menu)

$gui_iewindow = GUICtrlCreateObj($oIE, 0, 0, $read_width, $read_height - 45)
GUICtrlSetResizing($gui_iewindow, 0x0001)

$address_bar_label = GUICtrlCreateLabel("Enter Address: ", 0, 562, 85, -1)
$address_bar_input = GUICtrlCreateInput($read_homepage, 76, 559, 200, -1)
$address_bar_go = GUICtrlCreateButton("Go >>", 280, 557, 50, -1, 0x0001)
$address_bar_stop = GUICtrlCreateButton("Stop", 330, 557, 50, -1)
$address_bar_back = GUICtrlCreateButton("Back", 380, 557, 50, -1)
$address_bar_forward = GUICtrlCreateButton("Forward", 430, 557, 50, -1)
$address_bar_refresh = GUICtrlCreateButton("Refresh", 480, 557, 50, -1)
$address_bar_home = GUICtrlCreateButton("Home", 530, 557, 50, -1)

$status_bar = GUICtrlCreateLabel("Loading: " & $read_homepage & "...", 0, 584, $read_width, $read_height, BitOR(11, 0x1000))

GUISetState()

AnimateTitle($gui_main, "NetZilla - Created by Farhan879", 100)
$oIE.Navigate ($read_homepage)

$gui_pref = GUICreate("Preferences", 298, 230, 359, 233)
$group1 = GUICtrlCreateGroup("Settings", 16, 16, 265, 170)
$label_home = GUICtrlCreateLabel("Homepage:", 32, 40, 59, 17)
$input_add = GUICtrlCreateInput($read_homepage, 96, 40, 161, 21)
$label_start = GUICtrlCreateLabel("On Startup:", 32, 80, 58, 17)
$combo_startup = GUICtrlCreateCombo("", 96, 80, 161, 25)
If $read_starthomepage = "0" Then
    GUICtrlSetData(-1, "Start with Homepage|Start with Last Visited", "Start with Last Visited")
Else
    GUICtrlSetData(-1, "Start with Homepage|Start with Last Visited", "Start with Homepage")
EndIf
#cs
    $pref_Status_Status = GUICtrlCreateLabel("Display Width", 32, 110, 58, 71)
    $pref_width_input = GUICtrlCreateInput($read_width, 80, 115, 58, 20)
    $pref_height_label = GUICtrlCreateLabel("Display Height", 32, 140, 58, 71)
    $pref_height_input = GUICtrlCreateInput($read_height, 80, 145, 58, 20)
#ce
$button_apply = GUICtrlCreateButton("Apply", 120, 190, 75, 25, 0)
$button_close = GUICtrlCreateButton("Close", 208, 190, 75, 25, 0)
GUISetState(@SW_HIDE, $gui_pref)

While 1
    WinSetTitle($gui_main, "", "NetZilla - Created by Farhan879 " & $oIE.locationURL ())
   
    If $oIE.Busy () Then
        $url = $oIE.LocationURL ()
        _StatusChange("Loading: " & $url & "...")
    Else
        _StatusChange("Done.")
    EndIf

    $msg = GUIGetMsg(1)
    Switch $msg[0]
        Case - 3
            $update = $oIE.LocationURL ()
            IniWrite($ini, "URL", "LAST URL", $update)
            FileDelete(@TempDir & "\SWBHelpFile.exe")
            Exit
            ;File Menu
        Case $fm_newwind
            Run("NetZilla.exe")
        Case $fm_open
            Local $file = FileOpenDialog("NetZilla : Select file", @ScriptDir, "All Files (*.*)")
            If @error <> 1 Then
                _StatusChange("Loading: " & $file & "...")
                $oIE.Navigate ($file)
            EndIf
        Case $fm_print
            $oIE.document.parentwindow.Print ()
        Case $fm_savas
            $oIE.document.execCommand ("SaveAs")
        Case $fm_SaveSource
            $IE = _INetGetSource("" & $update & "")
            FileWrite(@DesktopDir & "\websource.html", $IE)
            MsgBox(64, "NetZilla", "Saved to desktop as websource.html")
        Case $fm_exit
            $update = $oIE.LocationURL ()
            IniWrite($ini, "URL", "LAST URL", $update)
            Exit
            ;View Menu
        Case $vm_status
            $size = WinGetPos("NetZilla")
            If BitAND(GUICtrlRead($vm_status), 1) = 4 Then
                GUICtrlSetState($vm_status, 4)
                GUICtrlSetState($status_bar, 32)
                WinMove("NetZilla", "", $size[0], $size[1], $size[2], $size[3] - 15)
            Else
                GUICtrlSetState($vm_status, 1)
                GUICtrlSetState($status_bar, 16)
                WinMove("NetZilla ", "", $size[0], $size[1], $size[2], $size[3] + 15)
            EndIf
        Case $tm_pref
            GUISetState(@SW_SHOW, $gui_pref)
        Case $tm_gu
            $update = $oIE.LocationURL ()
            MsgBox(0, "NetZilla", "URL:" & $update & "")
            ClipPut($update)
        Case $button_close
            GUISetState(@SW_HIDE, $gui_pref)
        Case $button_apply
            ;$getwidth = GUICtrlRead($pref_width_input)
            ;$getheight = GUICtrlRead($pref_height_input)
            ;IniWrite($ini, "Display", "Width", $getwidth)
            ;IniWrite($ini, "Display", "Height", $getheight)
            $gethome = GUICtrlRead($input_add)
            $getstarthome = GUICtrlRead($combo_startup)
            If $getstarthome = "Start with Homepage" Then
                IniWrite($ini, "Settings", "StartHomepage", "1")
            Else
                IniWrite($ini, "Settings", "StartHomepage", "0")
            EndIf
            IniWrite($ini, "Settings", "Homepage", $gethome)
            GUISetState(@SW_HIDE, $gui_pref)
            _StatusChange("Configuration written successfully.")
            sleep(1000)
            ;About Menu
        Case $am_about
            MsgBox(64,"About","Product name:    NetZilla " & @CRLF & "Author:               Farhan (farhan_879@hotmail.com)" & @CRLF & "Version:              1.0" & @CRLF & "" & @CRLF & "© Copyright 2008. All rights reserved.")
            ;Address Bar Buttons
        Case $address_bar_go
            $addy = GUICtrlRead($address_bar_input)
            _StatusChange("Loading: " & $addy & "...")
            $oIE.Navigate ($addy)
            _StatusChange("Done.")
        Case $address_bar_stop
            $oIE.Stop ()
        Case $address_bar_back
            $oIE.GoBack ()
        Case $address_bar_forward
            $oIE.GoForward ()
        Case $address_bar_refresh
            $oIE.document.execCommand ("Refresh")
        Case $address_bar_home
            $read_homepageini = IniRead($ini, "Settings", "Homepage", "")
            $oIE.Navigate ($read_homepageini)
            GUICtrlSetData($address_bar_input, $read_homepage)
    EndSwitch
WEnd

Func _StatusChange($message)
    GUICtrlSetData($status_bar, $message)
EndFunc   ;==>_StatusChange




Func AnimateTitle($hGUI, $sTitle, $iBuf)
    $sTitle = StringSplit($sTitle, "")
    For $i = $iBuf To 0 Step - 1
        WinSetTitle($hGUI, "", _StringRepeat(" ", $i) & $sTitle[1])
    Next
    Local $s
    For $i = 1 To $sTitle[0]
        $s &= $sTitle[$i]
        WinSetTitle($hGUI, "", $s)
        Sleep(5)
    Next
EndFunc   ;==>AnimateTitle
Edited by farhan879

System task ---> My first GUICalculator v1.0 ---> My version of the calculatorNetZilla 1.0 --> Web browserEmail Sender --> You can Send emails with this without opening a web browser

Share this post


Link to post
Share on other sites
Kiesp

Nice little program, but i found some minor bugs.. :mellow:

When i move my curser around inside the window the title flashes..

When i click View -> Status Bar the windows height just increases with about 20.

When i make a new window it doesnt have a title.


http://www.autoitscript.com/forum/index.php?showtopic=69911 <-- Best hacker ever :D

Share this post


Link to post
Share on other sites
sumkid

awesome, i was having some problems with firefox and internet explorer and for some reason they could not play music on myspace. But for some reason this seemed to fix it. thanks =)

Share this post


Link to post
Share on other sites
JRowe

awesome, i was having some problems with firefox and internet explorer and for some reason they could not play music on myspace. But for some reason this seemed to fix it. thanks =)

This isn't a new browser. It's just IE with an other GUI.

This is internet explorer with a custom GUI.

I'm not posting this to bash the script creator; it's a neat script.

Share this post


Link to post
Share on other sites
Krypton88

Hey thanks for this simple browser! Im using it for a secure login with my big project! Dont worry I credited you on the "about" tab, I edited Alot of the functions out because I needed an even more simple browser lol! Just needed to set the homepage to my main secure login on my website, But I just wanted to let you know out of respect and to tell you I Credited you Respectivly :) thx again

Share this post


Link to post
Share on other sites
DeeRiee

This isn't a new browser. It's just IE with an other GUI.

Yes, its looks like maxthon, using IE too. :)


Sorry 4 Bad English, I'm Indonesian...I'm really need 'Translator' for helping me posting in this forum (http://deeriee.wordpress.com)

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.