Is there a way to tell which control has the focus?

I want to pass a control to a specific function only if it has focus.

Also my second question is...I want to use F7 as a "Sendkeys" or keydown event..but how do I check if this button is clicked.

I want it at the form level...
basically user hits F7 .. and the text box that has the focus calls a specific function that takes as a parameter that control.

THanks,
Jon