title: Same process IDs of all IE windows
body: <p>When I manually launch Internet Explorer windows, each one of them gets a different PID.  </p>
  
  <p>However, suppose I have manually opened one browser window and it gets PID 12345 and then run WaitiN which opens some browser windows, the PIDs of all WaiiN windows becomes 12345. How can I change the behaviour so that WatiN works like it works manually.  </p>
  
  <p>I need the PIDs so that I can close the broswer windows opened by WatiN in my cleanup code and make sure I close the PIDs of browser windows opened only by WatiN.</p>
  
  <p><strong>EDIT:</strong><br>
  Code I am using is:  </p>
  
  <pre><code>//Where I am using WatiN 1
  IE ReportWindow = IE.AttachToNoWait&lt;IE&gt;(Find.ByTitle("New Activity Recap"), 120);
  ReportWindowPID = ReportWindow.ProcessID;
  
  //Where I am using WatiN 2
  IE ReportWindow = IE.AttachToNoWait&lt;IE&gt;(Find.ByTitle("New Activity Recap"), 120);
  ReportWindowPID = ReportWindow.ProcessID;
  
  //Cleanup code
              foreach (Process p in System.Diagnostics.Process.GetProcessesByName("iexplore"))
              {
                  if (p.Id == ApplicationWindowPID || p.Id == ReportWindowPID)
                  {
                      try
                      {
                          p.Kill();
                          p.WaitForExit();
                      }
                      catch
                      {
                      }
                  }
              }
  </code></pre>
  
  <p>The above code is closing the 2 windows opened by WatiN as well as other windows.  </p>
  
  <p><strong>PS:</strong> ANy code which kills the browser windows by a URL can also do because the base URL is going to be the same in the 2 WatiN windows.</p>