Sign in to follow this  
Followers 0
tommytx

How to tell if oIE is running so I can navigate if running or create if not running.

7 posts in this topic

#1 ·  Posted (edited)

I am well familiar with determing what window oIE is running.. but how to tell if its up and running..PERIOD.. so if its running.. I can navigate and if not I can create...

$title = "Boom"

Local $oIE = _IEAttach($title)

if WinExists ($title) Then

MsgBox(0, "The URL", _IEPropertyGet($oIE, "locationurl"))

I have tried such dumb stuff as:

If $oIE then navigate....

If NOT $oIE then create IE and then navigate.

if WinExists("") then etc

In other words the title may be anything or nothing..

What can i ask the oIE for like a property that will tell me its running without causing it to abort and quit... The code above shows I know how to tell if its runnig when I know the title..

Thanks

Edited by tommytx

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

you can look do winlist("[CLASS:IEFrame]")

That will return an array of handles, which you can throw into _IEAttach($hwnd, "HWND")

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.

Share this post


Link to post
Share on other sites

Can you expound on that a little for us slow ones... LOL..

Something like: $array = winlist("[CLASS:IEFrame]")

Then study the array of handles and try to determine which handle applys to my instance of IE then place that handle into the variable $hwnd.

How bad did I buther that one.. boy I really know how to make something simple hard.. but anyway if you could break it down for me I would greatly appreciate it.

_IEAttach($hwnd, "HWND")

Share this post


Link to post
Share on other sites

$array = WinList("[CLASS:IEFrame]") will return a list of the IE windows that exist.

For example if there is only one instance of IE then $array[ 0 ][ 0 ] will be 1, and $array[ 1 ][ 1 ] is going to be the handle of that IE window.

Now that you have the handle just _IEAttach( $array[ 1 ][ 1 ],"HWND" ) to attach to the instance.


Cause no one here can ever stop us, they can try but we won't let them.. No way

Share this post


Link to post
Share on other sites

Or use WinExist("iexplore.exe") to test if IE is running.


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

_IEAttach includes an "instance" mode.  Example 5 for _IEAttach in the helpfile shows you how to loop through the existing IE windows and create an array of object references with them.  You could also examine title or url or any other attribute as you loop through them.

Dale

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Thanks... all those suggestions were helpful...

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