Exemple #1
0
        public void CloseTab(IntPtr ieHandle, string tabCaptionToClose)
        {
            AccessibleObjectFromWindow(GetDirectUIHWND(ieHandle), OBJID.OBJID_WINDOW, ref accessible);
            if (accessible == null)
            {
                throw new Exception();
            }

            var ieDirectUIHWND = new IEAccessible(ieHandle);

            foreach (IEAccessible accessor in ieDirectUIHWND.Children)
            {
                foreach (var child in accessor.Children)
                {
                    foreach (var tab in child.Children)
                    {
                        if (tab.Name == tabCaptionToClose)
                        {
                            foreach (var CloseTab in tab.Children)
                            {
                                CloseTab.Activate();
                            }
                            return;
                        }
                    }
                }
            }
        }
Exemple #2
0
        public void CloseTab(IntPtr ieHandle, int tabIndexToClose)
        {
            AccessibleObjectFromWindow(GetDirectUIHWND(ieHandle), OBJID.OBJID_WINDOW, ref accessible);
            if (accessible == null)
            {
                throw new Exception();
            }

            var ieDirectUIHWND = new IEAccessible(ieHandle);

            foreach (IEAccessible accessor in ieDirectUIHWND.Children)
            {
                foreach (var child in accessor.Children)
                {
                    foreach (var tab in child.Children)
                    {
                        object tabIndex = tab.accessible.get_accState(0);

                        if ((int)tabIndex == tabIndexToClose)
                        {
                            foreach (var CloseTab in tab.Children)
                            {
                                CloseTab.Activate();
                            }
                            return;
                        }
                    }
                }
            }
        }
 public void CloseIETab(string tabCaptionToClose)
 {
     foreach (Accessible accessor in Children)
     {
         foreach (var child in accessor.Children)
         {
             foreach (var tab in child.Children)
             {
                 if (tab.Name == tabCaptionToClose)
                 {
                     foreach (var CloseTab in tab.Children)
                     {
                         CloseTab.Activate();
                     }
                     return;
                 }
             }
         }
     }
 }