Is it possible to find out whether a textbox currently has the users focus? If so how can my application grab the text out of it.

(I am not trying to make a password sniffer, just add spellchecking facilty to programs such as notepad.)