Does any one know how to find the window title of the current active window on the desktop? One can always find the key window ( or event consuming window) within a application. but how will i find out top most window on which keyboard events are sent?
Check out the Accessibility API.
See HowToGetTheKeyWindow