This is the nature of the Windows OS. The OS always gives the highest priority and, therefore, first priority in terms of resources, to the active application. If you make another window active, the OS will prioritize that application to get the most CPU time. You can't override this. The only thing you could do that may help is to set CVI's sleep policy to "Do Not Sleep". This is done with the SetSleepPolicy function. A setting a "Do Not Sleep" tells the CVI run-time to take as much CPU time it can get, and never sleep, which releases CPU time to other applications.
It still may not get the execution time to be the same, but it should help some.
Best Regards,
Chris Matthews
National Instruments