This will return the focused window within the calling thread:
Code:
Private Declare Function GetFocus Lib "user32.dll" () As Long