M
Martin
Hi all,
I have a multithreaded application that has one worker thread that
does all the work in the background. There is some work that takes
some seconds of time. After that work is completed the worker thread
calls a delegate of the form using BeginInvoke. The delegate takes
data from the worker and presents results of the work to the user
using a MessageBox.
When the user does nothing during the work is in progress everything
is fine. But if the user during the work switches to another
application (so my app is not in foreground when the work finishes)
the MessageBox behaves strange - somehow it loses track of its parent
window, so when user clicks on the taskbar to get my app back to the
foreground, the MessageBox do not get to the foreground with the app,
it stays in the background. The only way how to bring it to front is
using Alt-Tab. Moreover the application does not respond to the user,
because it waits for confirmation of the MessageBox, so it the user
does not know about the problem with the MessageBox, he is very
confused and thinks that the application is dead...
Do you anyone know, where could be the problem?
Martin
I have a multithreaded application that has one worker thread that
does all the work in the background. There is some work that takes
some seconds of time. After that work is completed the worker thread
calls a delegate of the form using BeginInvoke. The delegate takes
data from the worker and presents results of the work to the user
using a MessageBox.
When the user does nothing during the work is in progress everything
is fine. But if the user during the work switches to another
application (so my app is not in foreground when the work finishes)
the MessageBox behaves strange - somehow it loses track of its parent
window, so when user clicks on the taskbar to get my app back to the
foreground, the MessageBox do not get to the foreground with the app,
it stays in the background. The only way how to bring it to front is
using Alt-Tab. Moreover the application does not respond to the user,
because it waits for confirmation of the MessageBox, so it the user
does not know about the problem with the MessageBox, he is very
confused and thinks that the application is dead...
Do you anyone know, where could be the problem?
Martin