You can also use the api call GetFocus(). It returns a handle to the control that is currently in focus. You can use other api calls to get the name.