Jump to content

Mini browser , address bar problem


Recommended Posts

So i have this little IE browser, and the deal is, it have a "address bar" but when i clock "Go" nothing happens, dont know whats wrong...

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#NoTrayIcon

$IE = _IECreateEmbedded()
$GUI = GUICreate("TEST", 500, 200, -1,-1,($WS_EX_LAYERED))
$input = GUICtrlCreateInput ("", 0, 0, 450, 20)
$IEGUI = GUICtrlCreateObj   ($IE, 0, 20, 499, 199)
$button = GUICtrlCreateButton ("Go!", 450, 0, 40, 20)
WinSetTrans($GUI, "", 140)
WinSetOnTop("TEST", "", 1)
GUISetState()
_IENavigate ($IE, "http://www.google.com", 0)

While 1
    $GUI = GUIGetMsg()
    $msg = GUIGetMsg()
    Select
        Case $GUI = $GUI_EVENT_CLOSE
            Exit
        Case $msg = $button
            _IENavigate ($IE, "" & $input, 0)
    EndSelect
WEnd
Link to comment
Share on other sites

you only use one call to GUIGetMsg() in the loop

read help file for GUICtrlCreateInput(), you need to read the control with GUICtrlRead()

you can make use of both the input control and the go button

as in any browser

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#NoTrayIcon

$IE = _IECreateEmbedded()
$GUI = GUICreate("TEST", 500, 200, -1,-1,($WS_EX_LAYERED))
$input = GUICtrlCreateInput ("", 0, 0, 450, 20)
$IEGUI = GUICtrlCreateObj   ($IE, 0, 20, 499, 199)
$button = GUICtrlCreateButton ("Go!", 450, 0, 40, 20)
WinSetTrans($GUI, "", 140)
WinSetOnTop("TEST", "", 1)
GUISetState()
_IENavigate ($IE, "http://www.google.com", 0)

While 1
    $msg = GUIGetMsg()
    Switch $msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $button, $input ; Go button or Enter key after typing in input edit control
            _IENavigate ($IE, GUICtrlRead($input), 0)
    EndSwitch
WEnd
Edited by rover

I see fascists...

Link to comment
Share on other sites

Thanks a lot :)

Last thing is, is it possible to make it so when you click "Go!" to go to the new page, it also refreshes it(when the new page has loaded), because it doesn't show up untill i refresh it :S ...

Edited by thelex
Link to comment
Share on other sites

  • 2 weeks later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...