May 20, 2010 at 8:12 PM
Edited May 20, 2010 at 8:16 PM
have you tried UISpy or UIAVerify to be sure that "Solution Explorer" is the correct name of the window?
In most cases I use
application.GetWindows().Where(p=>p.Name == "name").First();
works only for the main window in every case.
In some cases I use
List<Window> windows = application.GetWindows();
and a "for" or "foreeach" loop, to be sure I found the correct window.
if I don't found the window I wait a short time and try again
Or in other cases I use
application.GetWindows().Where(p=>p.AutomationElement.Current.AutomationId == "id").First();