{"id":21,"date":"2006-01-02T20:00:12","date_gmt":"2006-01-03T03:00:12","guid":{"rendered":"http:\/\/www.boxheap.net\/ddaniels\/blog\/?p=21"},"modified":"2009-05-16T10:48:06","modified_gmt":"2009-05-16T17:48:06","slug":"20060102","status":"publish","type":"post","link":"http:\/\/www.boxheap.net\/ddaniels\/blog\/2006\/01\/20060102\/","title":{"rendered":"20060102"},"content":{"rendered":"<h2>The differences between OnClose(), OnDestroy(), and DestroyWindow() (MFC\/WinAPI stuff).<\/h2>\n<p>\nI knoticed one programmer uses OnClose() to try to prevent the user<br \/>\nfrom closing the window when they shouldn&#8217;t. To do this, he only called CDialog::OnClose() from his overloaded OnClose when closing was allowed.\n<\/p>\n<p>\nOnDestroy() is another CWnd member. It&#8217;s called durring the<br \/>\ndestruction of the CWnd object. This is probably the most useful<br \/>\nfunction for doing cleanup.\n<\/p>\n<p>\nDestroyWindow() is yet another CWnd member. The MSDN documentation suggests that it might never get called unless the program explicity calls it. There is however a note that MFC&#8217;s might call it. Which, or when I&#8217;m not sure (isn&#8217;t CWnd part of MFC?).\n<\/p>\n<p>Drew Scott Daniels<\/p>\n<p>Resume: <a href=\"http:\/\/www.boxheap.net\/ddaniels\/resume.html\">http:\/\/www.boxheap.net\/ddaniels\/resume.html<\/a><br \/>\n<br \/>\nOriginally from: <a href=\"http:\/\/www.boxheap.net\/ddaniels\/notes\/20060102.html\">http:\/\/www.boxheap.net\/ddaniels\/notes\/20060102.html<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The differences between OnClose(), OnDestroy(), and DestroyWindow() (MFC\/WinAPI stuff). I knoticed one programmer uses OnClose() to try to prevent the user from closing the window when they shouldn&#8217;t. To do this, he only called CDialog::OnClose() from his overloaded OnClose when closing was allowed. OnDestroy() is another CWnd member. It&#8217;s called durring the destruction of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/posts\/21"}],"collection":[{"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":3,"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"predecessor-version":[{"id":23,"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/posts\/21\/revisions\/23"}],"wp:attachment":[{"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.boxheap.net\/ddaniels\/blog\/wp-json\/wp\/v2\/tags?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}