maybe we speaking the same?
"Besides that, you can always check via GetParent() whether the control having the focus belongs to your dialog or not."
what to do in case i will receive NULL? i understand getfocus will return != NULL just for one process and thread in system

seems dialog must somehow remember what will make focused again