Avoid trapping the focus in dialog windows in C++

Avoid trapping the focus in dialog windows in C++