Prevent applications from stealing focus in Windows 8

note: should work in earlier versions of windows too

1. open regedit*
2. navigate to HKEY_CURRENT_USER\Control Panel\Desktop (screenshot below)
3. change the value of ForegroundLockTimeout to 30d40  (by default the value is probably 0)

Restart may be required for the change to take effect.

*pssst.. 30d40 is the hex value for  200000

* to open regedit hit the windows key and search for "regedit"