CWnd::DestroyWindow virtual BOOL DestroyWindow( );Return ValueNonzero if the window is destroyed; otherwise 0.如果销毁了窗口,则返回非零值;否则返回0。 ResDestroys the Windows window attached to the CWnd object. The DestroyWindow member function sends appropriate messages to the window to deactivate it and remove the input focus. It also destroys the window’s 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.这个函数销毁一个与CWnd对象相连接的Windows窗口。DestroyWindow成员函数向窗口发送一个适当的消息,以使该窗口变为非激活的并移去输入焦点。它还销毁窗口的菜单,清除应用程序的队列,销毁定时器,清除剪贴板拥有权,并且如果CWnd对象位于剪贴板观察器链的顶部,还打断剪贴板观察器链。它向窗口发送WM_DESTROY消息和WM_NCDESTROY消息。它不销毁CWnd对象
virtual BOOL DestroyWindow( );Return ValueNonzero if the window is destroyed; otherwise 0.如果销毁了窗口,则返回非零值;否则返回0。 ResDestroys the Windows window attached to the CWnd object. The DestroyWindow member function sends appropriate messages to the window to deactivate it and remove the input focus. It also destroys the window’s 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.这个函数销毁一个与CWnd对象相连接的Windows窗口。DestroyWindow成员函数向窗口发送一个适当的消息,以使该窗口变为非激活的并移去输入焦点。它还销毁窗口的菜单,清除应用程序的队列,销毁定时器,清除剪贴板拥有权,并且如果CWnd对象位于剪贴板观察器链的顶部,还打断剪贴板观察器链。它向窗口发送WM_DESTROY消息和WM_NCDESTROY消息。它不销毁CWnd对象
例如,假定你在CView的派生类中重载了DestroyWindow。由于MFC的源代码在任何CFrameWnd的派生类中都没有调用DestroyWindow,因此除非你调用了它,否则你重载的DestroyWindow不会被调用。 如果该窗口是其它窗口的父窗口,当父窗口被销毁时,这些子窗口将被自动销毁。DestroyWindow成员函数首先销毁子窗口,然后销毁本窗口。 DestroyWindow成员函数也销毁CDialog::Create创建的无模式对话框。 如果要被销毁的CWnd是一个子窗口并且没有设置WS_EX_NOPARENTNOTIFY风格,则WM_PARENTNOTIFY消息将被发送到父窗口。