Is there a way to track which window currently has keyboard focus. I could handle WM_SETFOCUS for every window but I\'m wondering if there\'s an alternative, simpler method
You could monitor messages for the WM_ACTIVATE event.
ref