I'm having some problems with an application I created, using C#
and Windows Forms
, and the situation is as follows:
When the user tries to shut down the PC without first turning off the chat, windows will always be in the "Preparing to finish" screen, waiting for the pending processes to close and never leave this screen without the user "Force" / p>
I believe this behavior occurs because of this confirmation message that blocks thread
.
What I want to do is something like:
Request confirmation, but if the user does not respond within 30 seconds, for example, the confirmation is closed automatically and the application terminates.
However when using MessageBox.Show()
the user must always respond to close the process.
I thought of developing a form to make this notification, but I do not know how to simulate the behavior of MessageBox.Show()
by blocking the thread
of the UI and still check timer
to see if time has passed.
Any help that will lead me to achieve my goal and leave the users more "Happy" will be very welcome.