Quantcast
Viewing all articles
Browse latest Browse all 18858

Copy All Element of a Treeview in External Application in My Treeview

Hi

I have to copy all elements of  treeview of external application in a treeview of my application

i know the handle of external treeview and i write this code but i have only the root element 

 IntPtr handle = IntPtr.Zero;
            handle = (IntPtr)Convert.ToInt32(textBox1.Text);
            AutomationElement el = AutomationElement.FromHandle(handle);
            TreeWalker walker = TreeWalker.RawViewWalker;
            for (AutomationElement child = walker.GetFirstChild(el);
                child != null;
                child = walker.GetNextSibling(child))
            {
                //string stringa = String.Format(" (item {0} is a \"{1}\" with name \"{2}\"", i++, child.Current.LocalizedControlType, child.Current.Name);
                    MessageBox.Show(child.Current.Name);
               }
        }


Wacky Teseo


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>