I am trying to get all windows on desktop using Desktop.Instance.Windows() but it throws
ArgumentException - Value does not fall within expected range.
(But there is no argument being passed :S )
I tried taking the UIAutoamtion path-
AutomationElement rootElement = AutomationElement.RootElement;
var j = rootElement.FindAll(TreeScope.Subtree, Condition.TrueCondition);
FindAll throws the same exception.
What is the recommended approach for getting all windows.
Please let me know workarounds too.