Re: display message in work thread
Hi Mihajlo,
The method of posting to a UI window works for me, but you would obviously
want to throttle the messages if you think they may come too quickly. The
programmer has control over how this happens. I typically put in a "I don't
want to see any more of these" checkbox in my pop-up dialogs so the user can
ignore them if they want. You could also check for a duplicate message
type in the UI code and not display a message that is already reported.
Popping up a message box in the worker thread will work sometimes, but you
could get the same kind of problem with it becoming over zealous.
Tom
"Mihajlo Cvetanovic" <mcvetanovic@gmail.nospampls.com> wrote in message
news:eIjAaUSIIHA.3848@TK2MSFTNGP05.phx.gbl...
WJ wrote:
If I would display a message box in the worker thread, what's going to
happen.
The message box will be displayed, as intended. There won't be any
unwanted consequences. The worker thread will gain its message queue, but
you shouldn't worry about it, and after the message box is closed the
queue will just exist there doing nothing (or waiting to serve for another
message box).
Should I use user-interface-thread instead? Thanks.
Not in your case. Nor should you post messages to main thread (or some
window belonging to main thread) only so that main thread would pop up
message boxes. If you would do so then the user may be swamped with
message boxes, unable to close them all because they appear too fast.