强制关闭的MessageBox的MessageBox

由网友(憾随他而来)分享简介:让我给你的背景。我们有一个应用程序(中型)正在使用的MessageBox.show(....)在不同的地方(在几百个)。这些消息框worklfow的一部分,被用于通知,警告或采取从用户的输入。应用程序应该自动一段时间后注销,如果没有活动。我们有一个,虽然退出应用程序只是清理会话数据,明确的意见,并隐藏自身,以便在下次启...

让我给你的背景。我们有一个应用程序(中型)正在使用的MessageBox.show(....)在不同的地方(在几百个)。这些消息框worklfow的一部分,被用于通知,警告或采取从用户的输入。应用程序应该自动一段时间后注销,如果没有活动。我们有一个,虽然退出应用程序只是清理会话数据,明确的意见,并隐藏自身,以便在下次启动它不会有执行启动过程,是昂贵的时间期限要求。一切工作正常,但在一个场景中时,有部分画面消息框,用户离开机器没有响应的消息框,然后由于没有任何活动的应用程序注销。问题是消息框不会消失。

Let me give you the background. We have an Application(medium sized) that is using MessageBox.Show (....) at various places (in hundreds). These message boxes are part of worklfow and being used for informing,warning or take input from user. Application is supposed to auto log off after certain time if there is no activity. We have a requirement that while log out application just clean the session data , clear views and hide itself so that in next launch it wont have to execute the startup process which is costly in term of time. Everything is working fine but in a scenario when there is some message box on the screen and user left the machine without responding to message box and then due to no activity application log out. Problem is Message box wont disappear.

我如何关闭打开的邮件中,如果有的话,而隐藏的应用程序?

How I can close opened message box, if any, while hiding the application?

感谢。

推荐答案

这在MSDN论坛链接演示如何使用来关闭消息框的FindWindow 和发送 WM_CLOSE 消息。尽管有人问了.NET / Windows CE的,它可能会解决你的问题,它值得一看

This link on MSDN forums shows how to close a message box by using FindWindow and sending a WM_CLOSE message. Although the question was asked for .NET/WindowsCE, it might solve your problem, its worth a look

阅读全文

相关推荐

最新文章