Jump to content

how do I get the handle from _IECreate()?


 Share

Recommended Posts

After I create an instance of IE using

$ieObj=_IECreate("this URL")

I want to get the handle for the window that I just opened. I know I can get it by using

WinGetHandle("window's title goes here")

but I want something more reliable, in case the web page's title changes, or there's more than one window open with that title. Is there a way to use the object to get the window's handle?

If it makes things simpler, my goal is to detect whether or not the user has closed the instance of IE made by _IECreate().

Link to comment
Share on other sites

After I create an instance of IE using

$ieObj=_IECreate("this URL")

I want to get the handle for the window that I just opened. I know I can get it by using

WinGetHandle("window's title goes here")

but I want something more reliable, in case the web page's title changes, or there's more than one window open with that title. Is there a way to use the object to get the window's handle?

If it makes things simpler, my goal is to detect whether or not the user has closed the instance of IE made by _IECreate().

$hIE = _IEPropertyGet($oIE, "hwnd")

:D

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Link to comment
Share on other sites

You can also do WinGetHandle($ieObj)

I know that is not documented but if you do that, i.e, it will return 0x000C0646. Then if I do a WinGetHandle on that same window using the title it returns 0x000C0646.

[sub]Quantum mechanics: The dreams stuff is made of[/sub]

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