title: How can I prevent windows from showing in .NET?
body: <p>I'm currently working on an access control program in C# and I've come across the problem of blocking windows. The original idea I've come up with is rendering a plain black form over the position given by the IntPtr window handle of the process. The problem within that is updating the form's position smoothly and z-index of the position (being I don't want it topmost). I've also noticed a ridiculously high resource use with my solution as I was using a loop to constantly check position.</p>
  
  <p>Thus why I ask: What would be the best solution for this without eating major resources? The entry point is merely the name of the running process.</p>
  
  <p>Presently the idea is only blocking off browsers (IE: a school application to prevent distraction when a lecture is active).</p>
  
  <p><b>More Information:</b></p>
  
  <ul>
  <li><p>I'm not looking to close a window in
  my own application, I'm trying to
  obscure windows from other processes.</p></li>
  <li><p>My application is not a
  virus/annoying program, it's
  essentially meant to prevent uses of
  potentially distracting applications
  in a school environment. It's made
  for lectures in a school computer
  lab.</p></li>
  <li><p>I'm presently pulling the main window
  from the process caught by the
  process name of browsers.</p></li>
  <li><p>I can't completely disable the computers either.</p></li>
  </ul>