Jump to content

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


Recommended Posts

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
Link to comment
Share on other sites

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.
Link to comment
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")

Link to comment
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

Link to comment
Share on other sites

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

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

_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

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...