I developed something like this once for a Vision problem.
Here is the thread: How to switch to an external application