Jump to content

[Solved] How to figure out a specific IE window is active


Recommended Posts

The reason is because I want to run my script using specific URLs even though the website title is the same.

I tried WinActive ($sWinTitle) but when the other window is up, the script continues, even though it shouldn't.

I tried using _IEPropertyGet ($oIE, "locationurl") to try to use the URL (which is different for each window). Using the URL would work, but how do I check the URL of the window, if its active, without using the window object?

I thought of this function, $hWnd_Active = _IEPropertyGet($oIE, "hwnd"), but I wasn't sure really what to do with the window handle to check the URL?

I don't know, I didn't think it would be a big deal, but I am out of ideas.

Anyone?

Thanks,

Bre

Edited by BreCalmor
Link to comment
Share on other sites

The reason is because I want to run my script using specific URLs even though the website title is the same.

I tried WinActive ($sWinTitle) but when the other window is up, the script continues, even though it shouldn't.

I tried using _IEPropertyGet ($oIE, "locationurl") to try to use the URL (which is different for each window). Using the URL would work, but how do I check the URL of the window, if its active, without using the window object?

I don't know, I didn't think it would be a big deal, but I am out of ideas.

Anyone?

Thanks,

Bre

something like this?

$x = ControlGetText('Title of window Goes here','','[CLASS:Edit; INSTANCE:1]')
if $x = 'url' then
;something
elseif $x = 'someotherurl'
;something else
endif

It works for me with IE

Edited by DexterMorgan
code
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...