title: Program Freezes on MessageBox()
body: <p>Here's the problem:  The main GUI thread is performing a SendMessage to another GUI thread (yes, there are multiple GUI threads, and unfortunately this cannot change).  When that second GUI thread receives the SendMessage, it may decide to display a message box.  Some of the time, that MessageBox will 'freeze' the entire application.</p>
  
  <p>More specifically, the message box shows up, but the entire GUI is hung (user input does not work anywhere).</p>
  
  <p>I've verified with a debugger that the second GUI thread is spinning in the DialogBox2() function defined in user32.dll.  I can see in the disassembly that a message pump is being executed (I see IsDialogMessage/TranslateMessage/DispatchMessage being called).  Using spy++, I do not see any messages being processed for the message dialog box window.  I do see messages getting processed on the main GUI window (such as WM_SETCURSOR, though I do not thin they are being processed as I believe SendMessage doesn't execute a message pump).</p>
  
  <p>The second thread is executing code that is part of an MFC extension DLL, if that matters.</p>
  
  <p>I've tried using AfxMessageBox() / CWnd::MessageBox / ::MessageBox(NULL parent window,...).  All exhibit the same problem.</p>
  
  <p>Has anyone seen anything similar before?</p>
  
  <p>Thanks,
  Andrew</p>