How to know when a tab is switched in IE7

Hi,

i'm developing a toolbar to IE7 using the example in codeproject, using .net (c#).

for each tab i get a new toolbar created, and i want to know whenever the tab is changed in IE. meaning, i need some kind of event, like a "tabchanged" event to register to.

does anyone know about such an event
is there anything similar that i can work with (SHDocVw or something)

thanks


Answer this question

How to know when a tab is switched in IE7

  • PeterKar

    With the BandObject you could also use Explorer.TitleChange event.

    Every time a tab is clicked the Title of IE changes...



  • yhal

    Can't you use cablehead's code and just keep track if you are just refocusing on the same tag that is already focused so you know if the focus event represents a change of tabs or just the user focusing on another window

  • vbjunkie

    yeah, it is changed, but it changes when i stay in the same tab and navigate to another page...

    can i develop a toolbar which works on all opened tabs now, i get a new toolbar instance for each tab, and that's why i have this problem. if i could somehow keep only one toolbar for the whole IE process and not for each tab, my problem will be gone. is there any way of doing this i'm using the BandObject from CodeProject


  • LearnToRock

    *bump*

    isn't there such an event


  • ykgreene

    Thanks,

    however, this event is a kind of "onfocus" event, and it fires each time the tab recieves focus.

    while when the tab is switched it receives focus and the event is fired, it fired at other occurrences as well: for example if we switch windows (say to other application than IE), and the focus returns to the tab.
    and this is not quite what i was looking for.
    is there such event is there a workarround for this problem

    thanks

  • Kickaha

    Explorer.WindowStateChanged += new SHDocVw.DWebBrowserEvents2_WindowStateChangedEventHandler(Explorer_WindowStateChanged);

    private void Explorer_WindowStateChanged(uint dwWindowStateFlags, uint dwValidFlagsMask)

    {

    if (dwWindowStateFlags == 3)

    {

    }

    else

    {

    }

    }



  • How to know when a tab is switched in IE7