Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Jun : GetForegroundWindow

www.cryer.info
Managed Newsgroup Archive

GetForegroundWindow

Subject:GetForegroundWindow
Posted by:"David" (david.markie@nospam.com)
Date:Sun, 4 Jun 2006 11:14:23

I have a routine to log when my application loses input focus and I am now
trying to extend this to log which application 'took' away the input focus.

WndHandle:=GetForegroundWindow();
  if WndHandle<>0 then
    log details of new foreground window....

If input focus is changed by clicking on the title bar of another
application or Alt+Tab then all is OK and GetForegroundWindow is valid, but
if applications are switched by clicking the Taskbar buttons
GetForegroundWindow returns zero.

Any suggestions as to how to get the newly active application after a
Taskbar button click

Thanks


David

Replies:

www.cryer.info
Managed Newsgroup Archive