I am trying to get the handle of a window from a process. Now, that process shows a splash screen, so, if i try ProcessInstance.MainWindowHandle all I get is the handle of that processes main window, that is the splash screen.
How can I find the window I want? Maybe if I could get a list of windows that process has I could pick the one I want.
Heres the code I am trying :
AutomationElement aeProcessInstance =
AutomationElement.FromHandle(mProcess.MainWindowHandle);
AutomationElement aeButton = aeProcessInstance.FindFirst(
TreeScope.Descendants,
new PropertyCondition(AutomationElement.NameProperty, "Start"));
aeButton.SetFocus();
Thread.Sleep(1000);
SendKeys.SendWait("{ENTER}");