C# determine the last few optimum applications in order

Is it possible to get a list of applications, in order that they were last active.

Several years ago I developed my own mouse application, to be used in conjunction with voice recognition software. I gave up using it, primarily because my application removed the focus from the application I am working with.

I am considering resurrecting this and extending it so it works with multiple monitors but I would like to be able to switch back to the application I was working with before I launched this mouse application. Also, I will have to check whether by issuing a voice command to launch this application, whether the voice recognition software temporarily gets the focus, hence why it might not be as simple as the last active application.