Identifying when a control would have the focus

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have an application with many windows on the same thread. I would like to
know the currently focused control in a particular window, whether or not that
parent window has the focus. I can't use GetFocus, since if another parent
window is active, I get the control from that window. I can't use
GetGUIThreadInfo, since all the top level windows are on the same thread.

Obviously Windows must maintain this information, since if I switch windows
and switch back, then the same control is focused as before I switched
away. How can I get hold of this information?

Thanks,

Anthony
--
Anthony Williams
Software Developer
.


Quantcast