When programs start stealing focus, they "pop up" in front of the window that you're currently viewing. A default setting in Windows prevents this from happening. If programs are stealing focus from your current window then this setting has been changed.
Follow the instructions below to stop this from happening for good.
Note: Changes to the Windows Registry are made in these steps. Take great care in making only the changes described below. I recommend that you backup the registry keys you're modifying in these steps as an extra precaution.
Click on Start and then Run.
In the text box in the Run window, type regedit and click OK. This will open the Registry Editor program.
Locate the HKEY_CURRENT_USER folder under My Computer and click on the (+) sign next the folder name to expand the folder.
Continue to expand folders until you reach the HKEY_CURRENT_USER\Control Panel registry key.
Select the Desktop key under Control Panel.
On the right-hand side of the screen, locate and double-click on the ForegroundLockTimeout DWORD.
In the Edit DWORD Value window that appears, set the Value data: field to 30d40.
Note: Make sure the Base option is set to Hexadecimal when entering the DWORD value.
Click OK and then close Registry Editor.
Reboot your PC for the changes you made to take effect.
From this point forward, programs should no longer steal the focus from the window that you're currently working in.