Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5997919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T00:19:55+00:00 2026-05-23T00:19:55+00:00

Here’s the problem: The main GUI thread is performing a SendMessage to another GUI

  • 0

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.

More specifically, the message box shows up, but the entire GUI is hung (user input does not work anywhere).

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).

The second thread is executing code that is part of an MFC extension DLL, if that matters.

I’ve tried using AfxMessageBox() / CWnd::MessageBox / ::MessageBox(NULL parent window,…). All exhibit the same problem.

Has anyone seen anything similar before?

Thanks,
Andrew

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T00:19:56+00:00Added an answer on May 23, 2026 at 12:19 am

    It must be that blocking one of the GUI threads causes the problem.

    Try this:

    Replace the ::SendMesage with ::PostMessage followed by a ::MsgWaitForMultipleObjects loop. You will need to pass an event handle that signals when the message box is closed.

    It will probably solve the problem.

    Just be careful which messages you dispatch in you ::MsgWaitForMultipleObjects loop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's a coding problem for those that like this kind of thing. Let's see
Here is another spoj problem that asks how to find the number of distinct
Here's a problem I ran into recently. I have attributes strings of the form
Here's my scenario - I have an SSIS job that depends on another prior
Here's an interesting problem. On a recently installed Server 2008 64bit I opened IE
Here’s a problem I’ve really been struggling with. I need to merge two sorted
Here's an excerpt from java.text.CharacterIterator documentation: This interface defines a protocol for bidirectional iteration
here's what I currently have, unfortunately I cannot seem to figure out how to
This is beyond both making sense and my control. That being said here is
Here is a synopsis of my code which is a moderately complex WinForms GUI.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.