title: How can I prevent focus stealing in Windows?
body: <p>A quick Google search for solutions to <a href="http://en.wikipedia.org/wiki/Focus_stealing" rel="noreferrer">Focus Stealing</a> in Windows reveals two main result categories:</p>
  
  <ul>
  <li>People suggesting incomplete solutions involving the
  ForegroundLockTimeout registry entry (or TweakUI, which I believe simply changes the aforementioned registry entry),
  which isn't very effective.</li>
  <li><a href="http://www.windows7taskforce.com/view/3681" rel="noreferrer">Incessant</a> <a href="http://www.vistaheads.com/forums/microsoft-public-windows-vista-administration-accounts-passwords/52293-stealing-focus.html" rel="noreferrer">hordes</a> of Windows users <a href="http://www.codinghorror.com/blog/2007/12/please-dont-steal-my-focus.html" rel="noreferrer">complaining</a> about <a href="http://www.dslreports.com/forum/r20852170-Vista-Stop-stealing-focus" rel="noreferrer">it</a>.</li>
  </ul>
  
  <p>It's particularly annoying in two common scenarios:</p>
  
  <ul>
  <li><p>Something triggers a program to popup a dialog window in the background while a fullscreen app is focused, causing the fullscreen app to minimize.</p></li>
  <li><p>A window steals focus while you are typing, stealing all of your keystrokes. If you happen to press Space, Enter, or trigger a keyboard shortcut (like Y for Yes), it can cause completely undesirable outcomes.</p></li>
  </ul>
  
  <p>What creative solutions can be applied to fix this problem for either or both of these scenarios?</p>