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 8091129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T19:57:54+00:00 2026-06-05T19:57:54+00:00

Generally, message boxes work like this: if(ShowMessageBox(Title,Text,MB_YES_NO) == MB_YES) { //the user responded yes

  • 0

Generally, message boxes work like this:

if(ShowMessageBox("Title","Text",MB_YES_NO) == MB_YES)
{
   //the user responded yes
}

However, I’m working on a game where I have made the gui system, and when a messagebox is shown, there is still animation happening in the background so I cannot simply block the thread, the animation would stop.

Right now, the way it works is to show the message box, an IMessageHandler* must be provided and it is called with the dialog result.

I’m wondering if I’m overlooking something. Is there a better way to do this that might resemble more how it is usually done. How might other games approach it?

Thanks

  • 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-06-05T19:57:57+00:00Added an answer on June 5, 2026 at 7:57 pm

    There are multiple options, e.g…

    1. Create a View-Model class that the message box reads from (title, message, button text) and writes to (result prior to closing), pass the VM to your message box before displaying it, then read result from VM after close.

      (A better technique would to use a command pattern or place an event on the message box instead of passing VM to message box, then within command/event handler update VM).

    2. Use a command pattern or an event to pass result from message box (prior to close) directly to caller (or to view model).

    3. Use a show dialog style call to message box (blocking), however, do that on a separate thread, then write results to a place where main thread can read from.

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

Sidebar

Related Questions

Thanks for your time and sorry for this long message! My work environment Linux
I generally don't like asking what's wrong with my code questions, but this is
So I saw code like this: template<class T> T* safe_ptr_cast(Message& msg) { assert(msg.header()->size() ==
Generally we import a tlb file at the starting of the program like #include
Generally speaking, I am very happy with the changes in Xcode 3.2. However, there
Generally speaking, what are your recommendations on this? Currently takes close to 10 minutes
I use Xcode 4.2 and I get 90% of the time this message: @autoreleasepool
I create a form form infopath. On that form I took the text boxes
Having friendly URLs is generally a good thing. However, there are sometimes when it
I am using macports to install various modules. Generally this works well, but below

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.