通过在VC ++中单击对话框中的关闭图标,无法关闭窗口 [英] Window is not closing by clicking close icon in dialog in VC++

查看:232
本文介绍了通过在VC ++中单击对话框中的关闭图标,无法关闭窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,有人可以通过单击标题栏中的关闭图标来说明为什么窗口没有关闭吗? )并阻止默认的消息处理.


可能是因为对话框缺少消息处理程序.

在这里看看:
Windows消息处理-第1部分 [ 解决方案

You have overridden WM_CLOSE (or Onclose) 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: handle WM_CLOSE or WM_COMMAND and close the window by calling EndDialog.
2) Modeless windows (popup or overlapped) handle the WM_CLOSE message by DestroyWindow.
3) Application windows: handle the WM_CLOSE or any command by DestroyWindow and handle the WM_DESTROY by PostQuitMessage to end the message loop.
Regards.


这篇关于通过在VC ++中单击对话框中的关闭图标,无法关闭窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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