|I think you could:
1- Create an array of
HWND's, that is enough to accomodate all the children.
OnInitDialog() function, take the
HWND's associated with all the children into that array using
3- Now start the timer at about 100ms etc.
4- In the timer function, check if any of the
HWND's in the array has focus.
GetFocus(). It will return
BOOL to let you know that somebody in that array has the focus. If nobody in that list has the focus, then hide the dialog using
ShowWindow(SW_HIDE) etc. or close it, whatever you want.
5- Create this dialog as Modeless.
6- Now you are good to go.
And about KillFocus() etc, those functions don't work, because if there is even one child (except statics etc) on the window, that child will keep the focus, and the parent will never get the focus.
Hope that helps.
this is this.