what window lost focus

  • Thread starter Thread starter David Ellis
  • Start date Start date
D

David Ellis

I am working on an on-screen keyboard. To do so, I need to know what window
had the focus prior to my window getting it. It is my understanding that the
wParam no longer has the handle of the window that has lost the focus if
that window is from another thread.

I am aware that I can call GetForegroundWindow to find out the foreground
window and use AttachThreadInput to allow me to call GetFocus. This works
but I need to call GetForegroundWindow prior to my window getting focus. Is
there a message that is always sent to a window just before it gets the
focus while the previous window still has the focus?

Dave
 
Could you set a hook with HCBT_ACTIVATE and use the hWndActive member of the
CBTACTIVATESTRUCT to get a handle to the window about to be deactivated?


{L}
 
Back
Top