Sign in to follow this  
Followers 0
chrshea

Tabbed Browser Problem

3 posts in this topic

I initially posted this in the General Support Forum (and didn't get a resolution) but it probably should have been posted here instead.

In a nutshell, I can't get a tabbed browser to handle keyboard input properly except on the last Tab that was opened. That one seems to be

active and remains active even when I open another tab. You can see in the example program below that the page on the third tab

works correctly and allows the cursor keys to be used to navigate the spreadsheet. If you open the second tab and use the cursor keys,

it continues to move the position in the third page. I have searched the forums and the Microsoft Com pages and tried different things but

I haven't been able to get past this. Using the IE.au3 UDF provides the same result.

; a tiny tabbed browser
; This version to demo problem with no keyboard controls except in the last tab

#include <GUIConstants.au3> 
#include <TabConstants.au3>
#include <WindowsConstants.au3>

$Form1 = GUICreate("Simple Web Browser MINI Version", 1100, 700, 10, 10) 

$win_style = BitOR($WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX, $GUI_SS_DEFAULT_TAB)
GuiCtrlCreateTab(10, 10, 930, 630, $win_style)

GuiCtrlCreateTabItem("Tab 1")
$oIEstart1 = ObjCreate("Shell.Explorer.2")
$GUIActiveXstart1 = GUICtrlCreateObj($oIEstart1, 12, 34, 1000, 650)
$oIEstart1.navigate("http://google.com")

GuiCtrlCreateTabItem("Tab 2")
$oIEstart2 = ObjCreate("Shell.Explorer.2")
$GUIActiveXstart2 = GUICtrlCreateObj($oIEstart2, 12, 34, 1000, 650)
$oIEstart2.navigate("http://www.editgrid.com/explore/user/jorgehen/planilha_orcamento_familiar_modelo")

GuiCtrlCreateTabItem("Tab 3")
$oIEstart3 = ObjCreate("Shell.Explorer.2")
$GUIActiveXstart3 = GUICtrlCreateObj($oIEstart3, 12, 34, 1000, 650)
$oIEstart3.navigate("http://www.editgrid.com/explore/user/altklausuren/P%C3%A4diatrie_AK")
GuiCtrlCreateTabItem("")

GUISetState(@SW_SHOW) ;Shows the GUI

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                Exit
        EndSwitch
    WEnd

The initial post in the General Support Forum is

A tabbed interface is great for combining local and internet content in an application. This problem really limits the ability to do that.

Any help would be appreciated.

Share this post


Link to post
Share on other sites



I did a lot of experimenting without finding a solution. This is mainly a problem for javascript-enabled windows that require keyboard input. You see this problem using online spreadsheets, online email like GMAIL and Yahoo mail and so forth. If you open a window just to browse, the problem isn't as apparent. If you open a Google search window, for example, you will probably be able to enter your search term however; if you try to backspace to change it or use the cursor keys, they don't work.

What I have found is that I get a very similar result opening multiple windows with an embedded browser window in each one. In that case, the first window opened, works fine (i.e. the keyboard controls work properly for that browser). If I close the first window, the second window then works fine. I haven't found a way to switch the keyboard connection to another window without closing the one that is currently active. I have tried enable, focus, WinActivate and so forth but nothing changes it.

Surely, someone has built a program with multiple browser windows and had them working correctly!

Share this post


Link to post
Share on other sites

I wasn't able to get multiple windows working properly using a normal embedded browser. Since there were no replies, maybe no one else has been able to either.

I found Zackrspv's routine and I have been able to use that for multiple individual browser windows and for windows that become children of a parent window. That works pretty well. I am working on using the "embedded" version in a tabbed structure. In that case, some of the tabs just act as triggers to display the browser windows that have been created with IECreate2 (embedded as children of the tabbed window). I may post some demo code once I get a cleaned-up version.

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