title: How do I find the window handle for a running process?
body: <p>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.</p>
  
  <p>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.</p>
  
  <p>Heres the code I am trying : </p>
  
  <pre><code>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}");
  </code></pre>