如何关闭MFC应用程序? [英] How to close MFC Application?

查看:107
本文介绍了如何关闭MFC应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码行来关闭在VC ++ 6中工作的MFC应用程序,但它在VC ++ 2010中失败



m_pMainWnd-> PostMessage(WM_CLOSE )



知道它有什么问题吗?



谢谢!

解决方案

可以通过一种或另一种方式阻止对此消息的处理。或者,您可以请求操作系统终止该线程: http ://msdn.microsoft.com/en-us/library/windows/desktop/ms644945%28v=vs.85%29.aspx [ ^ ]。



请尝试。



-SA


这些链接涵盖了关闭MFC申请的问题:



http://stackoverflow.com/questions/7562335/what-is-the-correct-way-to-programmatically-quit-an-mfc-application [ ^ ]



http://stackoverflow.com/questions / 3155782 / wm-quit-wm-close-and-wm-destroy-in-a-windows-pr [之间的区别是什么? ^ ]

I have the following code line to close a MFC Application which was working in VC++ 6, but it fails in VC++ 2010

m_pMainWnd->PostMessage( WM_CLOSE )

Any idea what is wrong with it?

Thanks!

解决方案

This handling of this message could be blocked in one or another way. Alternatively, you can request OS to terminate the thread: http://msdn.microsoft.com/en-us/library/windows/desktop/ms644945%28v=vs.85%29.aspx[^].

Please try.

—SA


These links cover the issue of closing MFC application:

http://stackoverflow.com/questions/7562335/what-is-the-correct-way-to-programmatically-quit-an-mfc-application[^]

http://stackoverflow.com/questions/3155782/what-is-the-difference-between-wm-quit-wm-close-and-wm-destroy-in-a-windows-pr[^]


这篇关于如何关闭MFC应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆