title: Windows XP Screen Saver - Launched Process Dies with Screen Saver
body: <p>I'm building a rather specialized screen saver application for some kiosks running Windows XP. Users tend to leave the kiosks without returning the browser to the homepage, so the screen saver does the following:</p>
  
  <ol>
  <li>Launches via the standard screen saver mechanism</li>
  <li>Notifies the user that there has been no recent activity, and that the browser will close in X seconds.</li>
  <li>If X seconds passes without user activity, the screen saver kills all current browser instances (via Process.GetProcessesByName) and starts a new instance of the browser that points to the configured web site (via Process.Start).</li>
  <li>The screen then "blanks out" until a user moves the mouse or presses a key - at this point the screen saver application exits.</li>
  </ol>
  
  <p>When this runs on Windows Vista or 2008, everything works as expected.</p>
  
  <p>However, on Windows XP (which is what the kiosks are running), when the screen saver application exits, the browser process is killed. If I add a Thread.Sleep just before the screen saver exists, I can see and interact with the browser up until the point at which the screen saver exits.</p>
  
  <p>To make matters more confusing, Windows XP does NOT exhibit this behavior when I run the screen saver by clicking the "Preview" button in the settings area - that is, it behaves as expected. The exact same code is run in this case.</p>
  
  <p>I tested this under the .NET 2.0 framework, and later installed .NET 2.0 SP1. On the Windows 2008 workstation, I have 3.5 SP1.</p>
  
  <p>Is there some difference between these versions of .NET with respect to dependencies on launched processes? Is there some flag I can set to make sure that the launched browser process is not "attached" to the screen saver application?</p>