Jump to content
Sign in to follow this  
BreCalmor

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

Recommended Posts

BreCalmor

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

Share this post


Link to post
Share on other sites
DexterMorgan

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

Share this post


Link to post
Share on other sites
Valuater

You can get the handle of the IE window to use with the Win* functions like this.

_IEPropertyGet($oIE, "hwnd")
8)

NEWHeader1.png

Share this post


Link to post
Share on other sites
BreCalmor

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

I don't understand it, but it worked !!

Thanks !!

Bre

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  

×