Under Windows XP the solution is formally simple:
→ General → Focus → Prevent applications from stealing focus
However, for me personally, it worked only for some time, and then app again become free to take on the focus whenever you want, ignoring this setting.
For Windows 7 there is a Ultimate Windows Tweaker
, positioning itself as a no
official TweakUI for Windows Vista/7. Maybe this setting is in him, and in Windows 7 it will probably work more reliably.