Jump to content

Get $o_object if IE already exists


Recommended Posts

in order to pass the "refresh" command to IE using the _IEAction func, you need the first parameter

Object variable of an InternetExplorer.Application

Which is easy enough to get using _IECreate

But first I want to check if IE is already open, if not then _IECreate

but if it is I need to assign $o_object with the variable so I can use the _IEAction later on.

#include <IE.au3>
$flag = 0
AdlibRegister('_refresh', 50000)
If Not WinExists("Yahoo - Windows Internet Explorer") Then
 $o_object = _IECreate ("[url="http://www.Yahoo.com"]http://www.Yahoo.com[/url]")
Else
 ;need to assign $o_object here
EndIf

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

yeah, but I don't want to create a 2nd instance of the website if it's already open.

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

#include <IE.AU3>
$flag = 0
;AdlibRegister('_refresh', 50000)
If Not WinExists("Yahoo! - Windows Internet Explorer") Then
    $o_object = _IECreate("http://www.yahoo.com")
Else
    $o_object = _IEAttach("http://www.yahoo.com/", "URL")
EndIf

This will open the browser to Yahoo if it doesn't already exist, otherwise it will look for a browser window with the yahoo URL. Check your window title too because yours says Yahoo - Windows Internet Explorer and mine says Yahoo! - Windows Internet Explorer.

Link to comment
Share on other sites

I'll try that, thanks.

I don't mess with IE functions very often so I'm not that good with them.

*edit* I missed the Opt("wintitlematchmode", 2)

but anyways, it does work. Thanks for the answer ;)

Edited by kaotkbliss

010101000110100001101001011100110010000001101001011100110010000

001101101011110010010000001110011011010010110011100100001

My Android cat and mouse game
https://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek

We're gonna need another Timmy!

Link to comment
Share on other sites

<p>If you want to check for ANY IE browser, as a precursor (used object spy on IE9 browser):

#include <IE.AU3>
$flag = 0
;AdlibRegister('_refresh', 50000)

$hndIE = WinGetHandle( "[Class:IEFrame]" )
If Not ishwnd($hndIE) Then
    $o_object = _IECreate("[url="http://www.yahoo.com"]http://www.yahoo.com[/url]")
Else
    $o_object = _IEAttach($hndIE, "HWND")
EndIf
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
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
 Share

  • Recently Browsing   0 members

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