With the MessageBox API function you can specify the MB_TASKMODAL flag which prevents any windows created by the current thread from receiving input. How can this be done by my own dialog?

I have a whole bunch of windows that are owned by my main window and setting my dialog's owner window to the main window doesn't prevent input to those other windows.