A
Adinb007
Guest
Hi Folks,
I need to double click on the child node below, i am able to get automation element for this SAPTreelist control but not sure how to navigate to the said child node and double click it.

Control Hierarchy using Spy++ along with control properties

Here is my C# Code
public bool SAPTreeList()
{
IntPtr parentHandle = FindWindow("#32770", "Archive from Frontend");
SwitchToThisWindow(parentHandle, true);
bool result = false;
try
{
var parentElements = AutomationElement.FromHandle(parentHandle).FindAll(TreeScope.Descendants, Condition.TrueCondition);
foreach (AutomationElement parentElement in parentElements)
{
if (parentElement.Current.ClassName != "")
{
if (parentElement.Current.ClassName == "SAPTreeList")
{
AutomationElement aeButton = parentElement.FindFirst(System.Windows.Automation.TreeScope.Element, new System.Windows.Automation.PropertyCondition(System.Windows.Automation.AutomationElement.NameProperty, parentElement.Current.Name));
}
}
}
}
catch (Exception ex)
{
result = false;
}
return result;
}
Aditya Sharma
Continue reading...
I need to double click on the child node below, i am able to get automation element for this SAPTreelist control but not sure how to navigate to the said child node and double click it.

Control Hierarchy using Spy++ along with control properties

Here is my C# Code
public bool SAPTreeList()
{
IntPtr parentHandle = FindWindow("#32770", "Archive from Frontend");
SwitchToThisWindow(parentHandle, true);
bool result = false;
try
{
var parentElements = AutomationElement.FromHandle(parentHandle).FindAll(TreeScope.Descendants, Condition.TrueCondition);
foreach (AutomationElement parentElement in parentElements)
{
if (parentElement.Current.ClassName != "")
{
if (parentElement.Current.ClassName == "SAPTreeList")
{
AutomationElement aeButton = parentElement.FindFirst(System.Windows.Automation.TreeScope.Element, new System.Windows.Automation.PropertyCondition(System.Windows.Automation.AutomationElement.NameProperty, parentElement.Current.Name));
}
}
}
}
catch (Exception ex)
{
result = false;
}
return result;
}
Aditya Sharma
Continue reading...