Jump to content
Sign in to follow this  
magician13134

IE....

Recommended Posts

magician13134

Sorry, but it's been a long time since I've worked with COM objects... Is it possible to communicate with an open IE window via autoit, or can I only create one?

If I use $oIE=ObjCreate("InternetExplorer.Application.1"), it creates a new IE window, I'm not sure how to go about talking to an open one...

Thanks

Share this post


Link to post
Share on other sites
DaleHohm

_IEAttach -- see the IE Management UDF


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

Share this post


Link to post
Share on other sites
kjactive

Hallo Magician13134

Windows come with two semilare IE activex componets buildin the system, the Webbrowser ( shell.explorer ) and Internetexplorer ( Explorer.exe ) - one opens a new window and the other ( webbrowser ) is ment to be embedded - do not attach the revision number last if you want your application to keep updated and talking to an open IE you do with Events that fires up when something happens in the window like in the example...

Personal I like another freeware IE browser ( library ) CWebpage.dll that automate most tasks - one of a kind library that do all from only five or six commands, read more about CWebpage.dll

http://www.codeproject.com/com/cwebpage.asp#DLL

; =======================================================================
; Small InternetExplorer.Application example by Kåre Johansson
; Requerement InternetExplorer.Application component - Explorer.exe
; =======================================================================

$ObjIE = ObjCreate("InternetExplorer.Application")
If Not IsObj($ObjIE) Then
    ConsoleWrite('InternetExplorer object failure...' & @CRLF)
    Exit
EndIf
$ObjIEEvt = ObjEvent($ObjIE,"InternetExplorerEvent_"); init the event handle process

With $ObjIE; object pool
   .Visible = True
   .Navigate('http://msdn2.microsoft.com/en-us/library/aa752043.aspx')

   While .ReadyState <> 4
      Sleep(50)
   WEnd
EndWith

$ObjIE = 0; remember to free object
Exit

; Event that fires up when navigation is compleated
Func InternetExplorerEvent_NavigateComplete($pDisp, $URL)
    ConsoleWrite('Navigation Compleate: ' & $pDisp & ' ' & $URL & @CRLF)
    While $ObjIE.ReadyState <> 4
      Sleep(50)
  WEnd
  Sleep(2500)
  $ObjIE.Quit
EndFunc

Read more about Windows default browsers

http://msdn2.microsoft.com/en-us/library/aa752043.aspx

kjactive :P

Edited by kjactive

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  

×