I did a search but could not find this, though I'm sure it's been answered before.

I need to be able to test whether my MDI app has the focus or not.

What's the best way to do this?