Sto cercando di trovare tutte le finestre del desktop usando .NET UIAutomation O White framework. ho provato:Trovare tutte le finestre sul desktop usando UIAutomation .NET
1.)
AutomationElement rootElement = AutomationElement.RootElement;
var winCollection = rootElement.FindAll(TreeScope.Subtree, Condition.TrueCondition);
2.)
Desktop.Instance.Windows();
Entrambi tiro ArgumentException. Per favore fatemi sapere se ci sono altri modi per farlo ...
UPDATE/ANSWER: Desktop.Instance.Windows(); funziona bene eccetto per il fatto che genera un'eccezione durante il debugging del codice usando VS2010.