Jump to content

How to get from Handle to Object


lfast
 Share

Recommended Posts

Another NubieQ: How do I create an _IE.au3 object for an existing explorer window? I can find the window and get a Handle using the non-IE functions. What's the magic incantation to convert a Handle into an Object? :graduated:

See _IEAttach ( Attach to the specified instance of Internet Explorer ) in help file ! Posted Image

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Link to comment
Share on other sites

example : detect only ie instance with http://www.youtube.com/watch?v= in the url and close them ! Posted Image

#include <IE.au3>
#include <Array.au3>

ShellExecute ( "iexplore.exe", "http://www.google.com/translate_t" )
ShellExecute ( "iexplore.exe", "http://www.autoitscript.com/forum/topic/122085-how-to-get-from-handle-to-object/page__gopid__847418#entry847418" )
ShellExecute ( "iexplore.exe", "http://www.youtube.com/watch?v=Dwimc4cvUmQ&feature=aso" )
ShellExecute ( "iexplore.exe", "http://www.google.fr/" )
ShellExecute ( "iexplore.exe", "http://www.youtube.com/watch?v=D7K3wFXJFsQ" )
Sleep ( 5000 )

Dim $oIEArray[1], $i = 1

While 1
    $oIE = _IEAttach ( "http://www.youtube.com/watch?v=", "URL", $i  )
    If @error = $_IEStatus_NoMatch Then ExitLoop
    _ArrayAdd ( $oIEArray, $oIE )
    $i += 1
WEnd

ConsoleWrite ( "Number of browser instances in the array: " & UBound ( $oIEArray ) -1 & @Crlf )

For $_I = 1 To UBound ( $oIEArray ) -1
    _IEQuit ( $oIEArray[$_I] )
Next
Edited by wakillon

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

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