I have a pretty basic understanding of the GUI thread and the message loop, but I'm curious as to how that applies to one window starting a modal window. If I had to guess, I'd say that both windows are being run under the same GUI thread and that some parameter indicates that only events with the child window (the modal one) be executed, otherwise point out the modal window to the user.
This is simply a semi-educated guess and I accept that I may be wrong from square one. I'm not even sure if "GUI thread" is the right name for that thread, but people usually can guess what I'm talking about.
So in short, how do threads and modal windows get along together?