#include <GUIConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <INET.au3>

$IE = _IECreateEmbedded ()

#Region ### START Koda GUI section ### Form=c:\users\killax2x\desktop\browser.kxf
$Form1_1 = GUICreate("Little Webbrowser made by killax2x based on the Internet Explorer", 1316, 759, 183, 107)
GUISetStyle ($WS_BORDER)
$adress = GUICtrlCreateInput("www.google.de", 208, 48, 521, 21)
$Label1 = GUICtrlCreateLabel("Web Adresse:", 80, 48, 104, 24)
GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif")
$go = GUICtrlCreateButton("Go!", 744, 48, 129, 25, 0)
$home = GUICtrlCreateButton("Home", 888, 48, 129, 25, 0)
$inet = GUICtrlCreateObj($IE,0, 104, 1313, 665)
$refresh = GUICtrlCreateButton("Aktualisieren", 208, 72, 113, 25, 0)
$print = GUICtrlCreateButton("Drucken", 616, 72, 113, 25, 0)
$save = GUICtrlCreateButton("Seite speichern", 328, 72, 281, 25, 0)
$exit = GUICtrlCreateButton("Beenden", 1096, 16, 193, 33, 0)
$back = GUICtrlCreateButton("<----", 56, 8, 81, 25, 0)
$next = GUICtrlCreateButton("---->", 144, 8, 81, 25, 0)
$datei = GUICtrlCreateMenu("&Datei")
$credits = GUICtrlCreateMenuItem("Credits", $datei)
$contact = GUICtrlCreateMenuItem("Kontakt", $datei)
$quell = GUICtrlCreateMenuItem("Seitenquellcode anzeigen", $datei)
$email = GUICtrlCreateMenuItem("Emailprogramm starten", $datei)
$end = GUICtrlCreateMenuItem("Beenden", $datei)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


_IENavigate ($IE,"www.google.de")


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			Exit

		Case $go
	$url = GUICtrlRead ($adress)
	_IENavigate ($IE,$url)
Case $home
	_IENavigate ($IE,"www.google.de")
Case $refresh
	_IEAction ($IE,"refresh")
Case $print
	_IEAction ($IE,"print")
Case $save
	_IEAction ($IE,"saveas")
Case $contact
	MsgBox (0,"Kontakt","Email: daniel_belz@gmx.net")
Case $credits
	MsgBox (0,"Credits","Little Webbrowser made by killax2x.Webbrowser is based of the Internet Explorer")
Case $end
	Exit
Case $back
	_IEAction($IE,"back")
Case $next
	_IEAction($IE,"forward")
Case $quell
	$sHTML = _IEDocReadHTML ($IE)
MsgBox(0, "Quelltext", $sHTML)
Case $email
$Address = InputBox('Adresse', 'Gib die E-Mail-Adresse des Empfängers ein:')
$Subject = InputBox('Betreff', 'Gib einen Betreff für die E-Mail ein:')
$Body = InputBox('Inhalt', 'Gib den Inhalt der E-Mail-Nachricht ein:')
MsgBox(0, 'Das E-Mail-Programm wurde geöffnet', 'Das E-Mail-Programm wurde geöffnet, dessen Prozess-ID lautet: ' & _INetMail($Address, $Subject, $Body))

Case $exit
	Exit
	EndSwitch
WEnd
