给应用程序发个消息让其退出,在主窗口中响应消息退出,若此时打开了其它窗口,如创建了一个模态对话框,此时主窗口响应消息并不能退出,原因是模态对话框没有关闭,这时关闭模态对话框会出现应用程序立即退出的状况。若主窗口打开的所有子窗口中没有模态对话框,主窗口就会各个子窗口发送销毁消息。先Destory子窗口,在退出自身。

MSDN:对DestoryWindow的解释.(WINCE)

This method destroys the Windows CE window attached to this CWnd object. The DestroyWindow method sends appropriate messages to the window to deactivate it and remove the input focus. It also destroys the Windows menu, flushes the application queue,
destroys outstanding timers, removes Clipboard ownership,
and breaks the Clipboard-viewer chain if CWnd is at the top of the viewer chain.
It sends WM_DESTROY and WM_NCDESTROY messages to the window. It does not destroy the CWnd object.

virtual BOOL DestroyWindow ( );
Return Value

Nonzero if the window is destroyed; otherwise, it is zero.

Remarks

DestroyWindow is a place holder for performing cleanup. Because DestroyWindow is a virtual function,
it is shown in any CWnd-derived class in ClassWizard. But even though you override this function
in your CWnd-derived class, DestroyWindow is not necessarily called.
If DestroyWindow is not called in the MFC code,
then you have to explicitly call it in your own code if you want it to be called.

Assume, for example, you have overridden DestroyWindow in a CView-derived class.
Since MFC source code does not call DestroyWindow in any of its CFrameWnd-derived classes,

your overridden DestroyWindow will not be called unless you call it explicitly.

If the window is the parent of any windows,

these child windows are automatically destroyed when the parent window is destroyed.
The DestroyWindow method destroys child windows first and then the window itself.

The DestroyWindow method also destroys modeless dialog boxes created by CDialog::Create.

If the CWnd being destroyed is a child window and does not have the WS_EX_NOPARENTNOTIFY style set,
then the WM_PARENTNOTIFY message is sent to the parent.

对DestoryWindow的解释.相关推荐

  1. TCP三次握手和四次挥手的解释

    基础知识 在TCP层,有个FLAGS字段,这个字段有以下几个标识:SYN, FIN, ACK, PSH, RST, URG. 其中,对于我们日常的分析有用的就是前面的五个字段. 它们的含义是: SYN ...

  2. java 解释型和编译型

    编译型语言和解释型语言 编译型语言: 举一个恰当的例子来理解,一本汉语的书,需要翻译成英文的书来帮助外国人理解,一种就是把正本书翻译完,然后给到外国人来阅读,这种方式就相当于编程中的编译型. 解释型: ...

  3. [翻译]Python中yield的解释

    问题: Python中yield关键字的作用是什么?它做了什么? 例如,我想理解以下代码 def node._get_child_candidates(self, distance, min_dist ...

  4. (康托展开解释)+ NYOJ 139 我排第几个

    描述 现在有"abcdefghijkl"12个字符,将其所有的排列中按字典序排列,给出任意一种排列,说出这个排列在所有的排列中是第几小的? 输入 第一行有一个整数n(0<n& ...

  5. 具体解释可变參数列表

    可变參数   至少有一个參数 比如:void add(int a,- ){} 例题  模拟printf()函数 #include <stdio.h> #include <stdarg ...

  6. 状态压缩dp(hdu2662)(我综合了一个人的解释和另一个人的代码)

    hoj 2662 大概题意是:有一个n*m的棋盘,在这个棋盘里边放k个旗子,要求每一行每一列都不能存在一对旗子相邻,问最后总共的方案数. 这道题一看状态非常多,就一定是状压.怎么状压呢?这又是个问题. ...

  7. java具有自动无用内存回收_Java语言程序设计(一)试卷及答案解释

    Java语言程序设计(一)试卷及答案解释 本试卷共6页,满分l00分,考试时间l50分钟. 第一部分选择题 一.单项选择题:本大题共l0小题,每小题l分,共10分.在每小题列出的备选项中只有一项是最符 ...

  8. jquery.datatable能返回数据绑不上_地磁场可以影响人体机能吗?解释有多种,但都不理想...

    信鸽辨别方向的能力特别强,即使上海的信鸽带到几千公里放飞,它仍然会飞回上海.路途中就是碰到狂风暴雨,它也不会迷失方向. 为什么它有这么大的辨别方向的本领呢?科学家对信鸽进行研究,做了这样一个有趣的实验 ...

  9. linux分区通俗讲解,linux硬盘分区基础及设备号的解释

    要了解linux分区,需要先明确一下主分区.扩展分区和逻辑分区这三个概念. 分区概念 主分区:一块物理硬盘上可以被独立使用的一部分,一个硬盘最多可以有4个主分区. 扩展分区:为了突破一个物理硬盘只能有 ...

最新文章

  1. python语言只采用解释一种翻译方式对吗_python-guide翻译
  2. jquery的文档处理(部分)
  3. android stadio svn 使用技巧
  4. jquery中的load()方法使用要点
  5. Visual Studio Online 的 FAQ:iPad 支持、自托管环境、Azure 账号等
  6. LeetCode 382. 链表随机节点(概率)
  7. Inkscape导出xaml
  8. MS-Sqlserver2008建立维护计划执行备份任务
  9. 程序员与产品经理大打出手,公司的处理结果让所有人都笑开了花
  10. 《CATIA V5 从入门到精通(第二版)》——2.5 草绘可视化设置(Visualization)
  11. 奥迪A6(C5)停车加热(驻车暖风)01406故障
  12. JS实现抽奖活动程序
  13. POJ 2240 HDU 1217 Arbitrage(Floyd)
  14. 重磅消息!微信电脑版本,终于支持刷朋友圈啦!附内测下载地址!
  15. 20.古体诗的平仄与三字脚
  16. 2022危险化学品生产单位主要负责人考试题库及模拟考试
  17. 聊一聊JAVA指针压缩的实现原理(图文并茂,让你秒懂)
  18. 【CMake】cmake的add_custom_command和add_custom_target指令
  19. 处理excel,该选择VBA,还是python?
  20. 米家车载空气净化器拆解报告

热门文章

  1. 1197: 考试排名(一)(结构体专题)
  2. vue mounted
  3. 基于python的深度学习框架有_《用Python实现深度学习框架》上市
  4. Visual C++注册
  5. 从Page结构来看达梦数据库是不是纯自研
  6. 淘宝运营 钻展基本了解 钻展投放方案 钻展投放注意的点
  7. 【算法】图解A* 搜索算法
  8. GetLastError返回值大全(英文最新版)(1000-4000)
  9. imagecreatefromjpeg():gd-jpeg:JPEG
  10. CC2530内部结构图