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