When a dialog appears, it should be "owned" by some window. The main effect of this "ownership" is that the dialog is always in front of the owner window. When either the dialog or the owner is raised, the other follows.
All CAPI functions which display a dialog allow you to specify the owner.
CAPI User Guide (Macintosh version) - 30 Aug 2011