Hello everyone!

I have a rather mysterious problem.
I have a mfc dialog based application (running on win xp sp3), and at the same time another mfc app that installs a global keyboard hook capturing the ESC key (this one is always hidden).

SOMETIMES when i press ESC key (with the dialog based application on top + focused) the dialog closes normally but it seems like it never returns the focus to the desktop (or any other window that is shown on screen).

I realize that because the keyboard hook does not respond to the ESC press after that UNLESS i click with my mouse on some desktop area.

Is this something that should happen at all??
Can it be that when a dialog is destroyed the focus is lost for the entire desktop??

Not really hoping for a definete answer but maybe someone has faced a similar problem.

Thanks in advance!