Jump to content
Sign in to follow this  

oIE - Check if user goes to google.com

Recommended Posts


Hey guys,

I was wondering if it's possible to check if a user goes to www.google.com in a oIE (or in other words -> If (google.com active) then (..) ). Let's use the example script for "GUICtrlCreateObj" found in our AutoIt3.chm.

#include <GUIConstants.au3>
; Simple example: Embedding an Internet Explorer Object inside an AutoIt GUI
; The full example is available in the test\ActiveX directory (TestXInternet.au3)
; See also: http://msdn.microsoft.com/workshop/browser/webbrowser/reference/objects/internetexplorer.asp

$oIE = ObjCreate("Shell.Explorer.2")

; Create a simple GUI for our output
GUICreate ( "Embedded Web control Test", 640, 580,(@DesktopWidth-640)/2, (@DesktopHeight-580)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
$GUIActiveX         = GUICtrlCreateObj      ( $oIE,      10, 40 , 600 , 360 )
$GUI_Button_Back    = GuiCtrlCreateButton   ("Back",     10, 420, 100,  30)
$GUI_Button_Forward = GuiCtrlCreateButton   ("Forward", 120, 420, 100,  30)
$GUI_Button_Home    = GuiCtrlCreateButton   ("Home",    230, 420, 100,  30)
$GUI_Button_Stop    = GuiCtrlCreateButton   ("Stop",    330, 420, 100,  30)

GUISetState ()       ;Show GUI


; Waiting for user to close the window
While 1
    $msg = GUIGetMsg()
        Case $msg = $GUI_EVENT_CLOSE
        Case $msg = $GUI_Button_Home
            $oIE.navigate("http://www.google.com");[b]If (google.com active) then (...)[/b]
        Case $msg = $GUI_Button_Back
        Case $msg = $GUI_Button_Forward
        Case $msg = $GUI_Button_Stop

GUIDelete ()


Thanks in advance!


Edited by _Kurt

Awaiting Diablo III..

Share this post

Link to post
Share on other sites

If  StringInStr($oIE.LocationURL, "www.google.com")  Then
    MsgBox(0, "Test", "Hurray! It Worked!")



This is how to do the same thing, without #include <IE.au3> ;)

Edited by 4gotn1

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.