I've been annoyed as hell by this for a long time and didn't know what to search to fix it. Now I've found it :megaman:
Scenario: A human being is typing or doing something that requires focus on a certain window, but then they go to launch a new program. To stay productive, they go back and continue typing or whatever they were doing while the new program is loading. When the program is finished loading, it steals the focus away and whatever was being done is now being done in the new active program, which often has screws things up pretty bad.
Code
Open your favorite registry editor.
Navigate to this key: HKEY CURRENT USER\Control Panel\Desktop.
In the right details pane, double click the item ForegroundLockTimeout.
In the value data field, set a hexadecimal value of 00030d40.
Click OK and close the registry editor.
Display More
I found this site that shows what registry key to edit that prevents that from happening. Pretty safe and easy, and should have pretty good benefits on productivity. Cheers!