Sign in to follow this  
Followers 0
Jannick2

IE __IENavigate to tab

3 posts in this topic

Hi all,

Im trying to to open a webpage on a new tab in IE. (with undocumented function __IENavigate).

So far no problem but when i try to do something on that page, eg _IELinkClickByIndex, the IE object thinks i'm talking about the fist tabpage instead of newly created tab.

Does anybody have an idea on how to set focus on the created tab?

tnx,

Jannick2

#include <IE.au3>
#AutoIt3Wrapper_run_debug_mode=Y

AutoItSetOption("WinTitleMatchMode", 4)

$oIE =_IEAttach(WinGetHandle("classname=IEFrame") ,"HWND")

if @Error=0 Then
    __IENavigate($oIE, "https://webmail.xyz.com/", 1, 2048)
Else
    MsgBox(0,"","Not found")
    $oIE = _IECreate ("https://webmail.xyz.com/",1)
EndIf


$oIE =_IEAttach(WinGetHandle("classname=IEFrame") ,"HWND")  ; does nothing interessting

[color="#FF0000"]; NEXT LINE GOES WRONG, focus is on the first tab instead of the newly created
_IELinkClickByIndex ( $oIE, 1)[/color]


;Input form 
$oForm = _IEFormGetCollection ($oIE,0)

$oUserName = _IEFormElementGetObjByName ( $oForm, "username")
$oPassword = _IEFormElementGetObjByName ( $oForm, "password")

;Input form invullen + submitten
_IEFormElementSetValue ($oUserName, "myUserId")
_IEFormElementSetValue ($oPassword, "myPass")

_IEFormSubmit($oForm)

Share this post


Link to post
Share on other sites



You'll need to use _IEAttach to get a reference to it. You've highlighted the main reason that __IENavigate is undocumented - it doesn't work the way you want it to.

Dale


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

tnx for the reply DaleHohm!!

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  
Followers 0