Where there are a couple of work-arounds to prevent this from happening. Perhaps the easiest is to get Microsoft's Tweak UI to disable it. Look for Focus in the General section of Tweak UI.
You can also do this through a registry setting:
- Start the Registry Editor: Go to Start | Run and enter regedit [Enter]
- Find HKEY_CURRENT_USER | Control Panel | Desktop
- Go to the Edit menu and select New > DWORD value
- Name the DWORD value "ForegroundLockTimeout"
- Assign a value of 30d40
- Close the Registry Editor
While your in the Registry Editor, you can also set how many times the Window seeking your attention flashes in your taskbar. This is another setting within HKEY_CURRENT_USER | Control Panel | Desktop:
- Add another new DWORD
- Name it "ForegroundFlashCount"
- Set it to the value equal to the number of flashes you want, e.g. 3
I have heard (though not experienced) that some times newly installed applications will change your setting back (allowing focus to be taken again). One work around is to execute a registry update each time you reboot (the other is to get a different program that wont make this change). Here is how you would create the file to execute each time you rebooted:
- Open a text editor such as Notepad
- Type the following (or copy and paste):
Windows Registry Editor Version 5.00
- Save the file focus.reg. If your using Notepad, be sure to quote it ("focus.reg"), otherwise it will add a .txt extension (focus.reg.txt).
- To get this file to execute with each new start, go to Start menu | All Programs
- Right-click on Startup and choose Explore
- Right-click in the right pane of your new Explorer window and choose New > Shortcut
- In the Shortcut Wizard, locate your registry file, Focus.reg
- The entry will contain the entire path, and will be quoted. To avoid being prompted each time to allow the Registry to be updated, enter regedit /s before the first quote. i.e. regedit /s "C:\Documents and Settings\Chris\Desktop\focus.reg"
- Name your shortcut, e.g. Focus