title: How do I gracefully close another application?
body: <p>I have a C++/CLI based install application which needs to close another app I've written, replace the application's .exe and dlls and the re-run the executable.</p>
  
  <p>First of all I need to close that window along the following lines:</p>
  
  <pre><code>HWND hwnd = FindWindow(NULL, windowTitle);
  if( hwnd != NULL )
  {
      ::SendMessage(hwnd, (int)0x????, 0, NULL);
  }
  </code></pre>
  
  <p>I.e. find a matching window title (which works) ...but then what message do I need send the remote window to ask it to close?</p>
  
  <p>...or is there a more .net-ish way of donig this without resorting to the windows API directlry?</p>
  
  <p>Bare in mind that I'm limited to .net 2.0</p>