Grabbing data from an unknown control-type

Jun 23, 2012 at 8:53 PM
Edited Jun 23, 2012 at 9:14 PM

Is it possible to change (select) Rows and grab data from the following area (see image)?

http://i.minus.com/jby7o2Gl0W9dHC.jpg

The header's (columns ) class is: "PokerStarsHeaderClass" and the lower half is: "PokerStarsListClass". As you can see that's not a regular control-type. Additionally I can add that the legacy pattern option is set to true: "IsLegacyIAccessiblePatternAvailable: true"

Is it possible to change (select) Rows and grab data from the area that I've described above?

That's the code so far:

Process[] proc = Process.GetProcessesByName("pokerstars");
AutomationElement window = AutomationElement.FromHandle(proc [0].MainWindowHandle);
//getting the header
PropertyCondition xEllist3 = new PropertyCondition(AutomationElement.ClassNameProperty, "PokerstarsHeaderClass", PropertyConditionFlags.IgnoreCase);
AutomationElement header = window.FindFirst(TreeScope.Children, xEllist3);
//getting the list
PropertyCondition xEllist2 = new PropertyCondition(AutomationElement.ClassNameProperty, "PokerstarsListClass", PropertyConditionFlags.IgnoreCase);
AutomationElement targetElement = window.FindFirst(TreeScope.Children, xEllist2);
//grabbing list's pattern.. not sure if necessary
if((bool)targetElement.GetCurrentPropertyValue(AutomationElementIdentifiers.IsLegacyIAccessiblePatternAvailableProperty))
{
var pattern = ((LegacyIAccessiblePattern)targetElement.GetCurrentPattern(LegacyIAccessiblePattern.Pattern));
}