G'day guys,

As an example I'll use notepad.

Notepad is easy, it just has the Edit box and we can find its handle via its class.

However, what if notepad had two edit boxes? How can we find which one currently has focus or is active (not sure how it actually works)

I want to go beyond GetForegroundWindow and I want to get more specific, is it possible to differentiate between a few items and grab only the handle of the one with focus?