Re: How to detect selected Tab in IE7?



peter.isberg@xxxxxxxxx a écrit :
Igor Tandetnik skrev:

Right. Isn't that the point? You wanted a unique HWND for each tab - you
got it.

;-), well not quite. I wanted to find a way to figure out how to detect
the selected tab. I.e. to get a pWebBrowser to that tab/object/ie.
Getting the unique HWND is of no use if I can't use it to get to the
object it represents.
I mean, I can enumerate all objects in the IE frame that is most on
top. I can find unique (useless) HWNDs for each tab. But, I still can't
detect what TAB that is currently selected.

My goal is to detect the selected tab and then communicate with that
object. I get close but no cigar.


/Peter


Hi,

There is no interface (the interface may exists, but no doc so far from MS) to get the info of the selected tab.
We solved the problem on our Inline Search plugin (http://www.ieforge.com/InlineSearch/HomePage) by using a tricky workaround (not beautiful but it is working !) :

1/ Get the HWND of the webbrowser in the tab (the HWND given by the code from Igor).
2/ Get the parent and then again the parent of this window.
3/ Check if this window (that is the parent/parent) is enabled. If so, this is the default tab, if not the tab is disabled.

You can iterate through all the webbrowser objects until you find the one that is activated.

If another solution exists, please do not hesitate to share. The solution I gave is still a workaround not really "strong".

--
Regards / Cordialement

====================
Jean-Fabrice Rabaute
CORE SERVICES :: Software/Web development & Consulting services

http://www.debugbar.com : The most advanced WEB development tool for Internet Explorer
http://www.core-services.fr - {Enjoy the future today}
.



Relevant Pages

  • Re: How to detect selected Tab in IE7?
    ... detect the selected tab. ... Getting the unique HWND is of no use if I can't use it ... You got the HWND from IWebBrowser2. ... I can find unique HWNDs for each tab. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Tab Key does not work in usercontrol
    ... you cannot shift + tab out of it but you can tab out of it. ... > HWND GetNextDlgTabItem( ... >> reason whyc the form is not getting tab key. ... >> TIA, ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: How to detect selected Tab in IE7?
    ... None of the HWND returned from the TAB objects via IOleWindow-> ... and I tried and failed with the child window ... I could spot with Spy++ on the active TAB. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: How to detect selected Tab in IE7?
    ... MS) to get the info of the selected tab. ... 1/ Get the HWND of the webbrowser in the tab (the HWND given by the code ... 2/ Get the parent and then again the parent of this window. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: How to detect selected Tab in IE7?
    ... Getting the unique HWND is of no use if I can't use it to get to the ... I can find unique HWNDs for each tab. ... My goal is to detect the selected tab and then communicate with that ... 1/ Get the HWND of the webbrowser in the tab. ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)