Sign in to follow this  
Followers 0
JustinReno

Simple Web Browser went Mini!

6 posts in this topic

#1 ·  Posted (edited)

Welcome to Simple Web Browser's little brother SWBMINI!

Features:

1. VERY SMALL COMPILED

2. 19 lines of code without comments

3. Browse Easily

Not very usefull but anyone can add on to it and make it they're own. Have fun!

CODE

#include <GUIConstants.au3> ;Makes the gui possible

#Include <ie.au3> ;Makes browsing the internet possible

$Form1 = GUICreate("Simple Web Browser MINI Version", 628, 436, 193, 115) ;Creates the GUI

$Obj1 = ObjCreate("Shell.Explorer.2") ;Creates the Internet Explorer Object

$Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 626, 412) ;Set Object on the GUI

$Button1 = GUICtrlCreateButton("URL", 0, 416, 627, 17, 0) ;Makes the Browse URL Button

GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") ;Sets the Font of the Button

_IENavigate($Obj1, "www.google.com") ;Before the GUI is shown, browse to google. Sorta like a homepage

GUISetState(@SW_SHOW) ;Shows the GUI

While 1 ;Creates a loop to capture the GUI Messages like close and the url button

$nMsg = GUIGetMsg() ;Gets the Message

Switch $nMsg

Case $GUI_EVENT_CLOSE ;If you pressed the close button

Exit ;It will exit

Case $Button1 ;If you pressed the URL Button

$URL = InputBox("SWBmini", "Type in the url you wish to go to:") ;Asks what url you want to go to

_IENavigate($Obj1, $URL) ;Navigate to the URL. This is what requires the IE.au3 at the top

EndSwitch

WEnd ;This ends the loop

And there is also one that opens the last page you browsed:

27 Lines of code

CODE

#include <GUIConstants.au3> ;Makes the gui possible

#Include <ie.au3> ;Makes browsing the internet possible

Global $ini = @ScriptDir & "\swb.ini" ;INI To Store Last WEBSITE Visited

$Form1 = GUICreate("Simple Web Browser MINI Version", 628, 436, 193, 115) ;Creates the GUI

$Obj1 = ObjCreate("Shell.Explorer.2") ;Creates the Internet Explorer Object

$Obj1_ctrl = GUICtrlCreateObj($Obj1, 0, 0, 626, 412) ;Set Object on the GUI

$Button1 = GUICtrlCreateButton("URL", 0, 416, 627, 17, 0) ;Makes the Browse URL Button

GUICtrlSetFont(-1, 10, 800, 0, "Arial Black") ;Sets the Font of the Button5

$iniread = iniread($ini, "URL", "LAST URL", "");Reads the ini so it can navigate to the last URL

If $iniread = "" Then ;If the ini doesnt have a previous saved url then write the default as google.com

iniwrite($ini, "URL", "LAST URL", "www.google.com") ;Writes google into the homepage

endif

$iniread1 = iniread($ini, "URL", "LAST URL", "");Reads the ini so it can navigate to the last URL

_IENavigate($Obj1, ""&$iniread1&"") ;Before the GUI is shown, browse to google. Sorta like a homepage

GUISetState(@SW_SHOW) ;Shows the GUI

While 1 ;Creates a loop to capture the GUI Messages like close and the url button

$update = _IEPropertyGet($Obj1, "locationurl") ;Gets the URL from internet explorer

IniWrite($ini, "URL", "LAST URL", $update) ;Writes the URL to the ini to navigate on startup

$nMsg = GUIGetMsg() ;Gets the Message

Switch $nMsg

Case $GUI_EVENT_CLOSE ;If you pressed the close button

Exit ;It will exit

Case $Button1 ;If you pressed the URL Button

$URL = InputBox("SWBmini", "Type in the url you wish to go to:") ;Asks what url you want to go to

_IENavigate($Obj1, $URL) ;Navigate to the URL. This is what requires the IE.au3 at the top

EndSwitch

WEnd ;This ends the loop

Edited by JustinReno

Share this post


Link to post
Share on other sites

Have you even bothered to check the date on this?

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