Jump to content

Tabbing With 2 Embedded IE Windows


user52
 Share

Recommended Posts

I've trimmed down the code, but I'm using multiple embedded ie windows. I noticed that when tabbing in the first embedded (google.com) the 2nd embedded window (yahoo.com) gets focus and tabs.

How can I keep the focus in the first window when tabbing?

I've found these

http://www.autoitscript.com/forum/index.php?showtopic=31539

http://www.autoitscript.com/forum/index.php?showtopic=32804

http://www.autoitscript.com/forum/index.php?showtopic=35742

Is $WS_TABSTOP what I want? Point me in the right direction

Thanks

#include <GuiConstants.au3>
#include <IE.au3>

HotKeySet("{ESC}", "_Exit")

$gui = GuiCreate("", 510, 620)
    $google_oIE = _IECreateEmbedded()
    $google_ie = GUICtrlCreateObj($google_oIE, 5, 5, 500, 300)
    _IENavigate ($google_oIE, "http://www.google.com/", 0)

    $yahoo_oIE = _IECreateEmbedded()
    $yahoo_ie = GUICtrlCreateObj($yahoo_oIE, 5, 310, 500, 300)
    _IENavigate ($yahoo_oIE, "http://www.yahoo.com", 0)
    
GuiSetState()

While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        Exit
    EndSelect
WEnd
    
Func _Exit()
    Exit
EndFunc
Link to comment
Share on other sites

lod3n did quite a lot of research (first two links you provided) on this and found a workaround that got him going. Unfortunately for you, his work did not conclude with a bug report for AutoIt, because it will take some in depth analysis from both AutoiIt GUI and COM devs to understand and make any changes to this behavior.

After the work that lod3n did I was never clear whether this was an issue somehow specific to IE or whether it related to a class of embedded objects -- if you can figure this out it would strengthen a bug report substantially.

Sorry I don't have anything else to offer at this point. Perhaps you can get lod3n to comment and then work on preparing a bug report.

Dale

Edit: typos

Edited by DaleHohm

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

Link to comment
Share on other sites

Hi,

just thinking loud...

Get them handles and them some logic to 'always focus on one of the windowhandles"...

Okay,

just thinking loud...

$CGH=ControlGetHandle("Google","","Internet Explorer_Server1"); ? might be: Google Internet Explorer ???

$oIEhhandleGoogle=__IEControlGetObjFromHWND($CGH)

and also:

$CGH=ControlGetHandle("Yahoo!","","Internet Explorer_Server1"); ?

$oIEhhandleYahoo=__IEControlGetObjFromHWND($CGH)

While blabla

focus/activate whatever

WEnd

Hope this helps (let us know...)

Link to comment
Share on other sites

thanks for the help no luck yet

i tried creating and then deleting the $yahoo_ie using GUICtrlDelete($yahoo_ie)

i tried

$cgh = ControlGetHandle("","",$google_oIE)
ControlSend($cgh, "", "Internet Explorer_Server1", "hey")  ;this line worked
Sleep(1000)
ControlSend($cgh, "", "Internet Explorer_Server1", "{TAB}")
Sleep(1000)
ControlSend($cgh, "", "Internet Explorer_Server1", "+{TAB}")
Sleep(1000)
ControlSend($cgh, "", "Internet Explorer_Server1", "^{TAB}")
Sleep(1000)
ControlSend($cgh, "", "Internet Explorer_Server1", "^+{TAB}")
Sleep(1000)
ControlSend($cgh, "", "Internet Explorer_Server1", "{TAB 30}")

can you delete the object that was created using GUICtrlCreateObj?

.

Link to comment
Share on other sites

can you delete the object that was created using GUICtrlCreateObj?

Set the object variable to null string or 0.

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

Link to comment
Share on other sites

For some reason this code keeps the focus in the first embedded window

#include <GuiConstants.au3>
#include <IE.au3>

$gui = GuiCreate(" ", 800, 600)
    
$oIE = _IECreateEmbedded ()
$ie = GUICtrlCreateObj($oIE, 0, 0, 800, 300)

GUICtrlCreateTreeView(0, 0)

$oIE2 = _IECreateEmbedded ()
$ie2 = GUICtrlCreateObj($oIE2, 0, 300, 800, 300)

GuiSetState()

_IENavigate($oIE,"http://www.google.com")
_IENavigate($oIE2,"http://www.yahoo.com")
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        Exit
    EndSelect
WEnd

any thoughts?

.

Link to comment
Share on other sites

does this page help??

http://msdn.microsoft.com/workshop/author/...ing_activex.asp

specifically...

Method - Description

IAccessible::accDoDefaultAction - Activates the control and will expose the ActiveX control or Java Applet within the MSAA tree.

IAccessible::accHitTest - Returns CHILDID_SELF

IAccessible::accLocation - Location of the underlying ActiveX control or Java Applet

IAccessible::accNavigate - Returns E_NOTIMPL

IAccessible::accSelect - Returns E_NOTIMPL

IAccessible::get_accChild - Returns S_FALSE

IAccessible::get_accChildCount - Returns 0 and S_OK

IAccessible::get_accDefaultAction - Returns "Select this control"

IAccessible::get_accDescription - Returns E_NOTIMPL

IAccessible::get_accFocus - Returns E_NOTIMPL

IAccessible::get_accHelp - Returns "This control is inactive. Select the control to activate and use it."

IAccessible::get_accHelpTopic - No Change - Returns E_NOTIMPL

IAccessible::get_accKeyboardShortcut - No Change - Delegates the object. If there is no object, the method returns E_NOTIMPL.

IAccessible::get_accName - Returns "Inactive Control"

IAccessible::get_accParent - No Change - Returns the closest accessible element in the parent chain.

IAccessible::get_accRole - Returns ROLE_SYSTEM_PUSHBUTTON

IAccessible::get_accSelection - Returns E_NOTIMPL

IAccessible::get_accState - Returns current state of the object. This state always includes STATE_SYSTEM_FOCUSABLE

IAccessible::get_accValue - Returns E_NOTIMPL

IAccessible::put_accName - Returns E_NOTIMPL

IAccessible::put_accValue - Returns E_NOTIMPL

all help is appreciated, thanks
Link to comment
Share on other sites

I looked at the link. Don't believe it is related.

I suggest you prepare a small reproducer and a problem description and place it in Bug Reports. This issue needs COM and GUI devs to analyze.

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

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