通过在VC ++中单击对话框中的关闭图标,无法关闭窗口 [英] Window is not closing by clicking close icon in dialog in VC++
本文介绍了通过在VC ++中单击对话框中的关闭图标,无法关闭窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,有人可以通过单击标题栏中的关闭图标来说明为什么窗口没有关闭吗? )并阻止默认的消息处理.
可能是因为对话框缺少消息处理程序.
在这里看看:
Windows消息处理-第1部分 [ 解决方案
You have overriddenWM_CLOSE
(orOnclose
) and prevent the default message handling.
Probably because the message handler is missing for the dialog.
Have a look here:
Windows Message Handling - Part 1[^]
Good luck!
There are a few ways to close windows:
1) Modal dialog: handleWM_CLOSE
orWM_COMMAND
and close the window by callingEndDialog
.
2) Modeless windows (popup or overlapped) handle theWM_CLOSE
message byDestroyWindow
.
3) Application windows: handle theWM_CLOSE
or any command byDestroyWindow
and handle theWM_DESTROY
byPostQuitMessage
to end the message loop.
Regards.
这篇关于通过在VC ++中单击对话框中的关闭图标,无法关闭窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文