{"id":104610,"date":"2020-12-28T07:00:00","date_gmt":"2020-12-28T15:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=104610"},"modified":"2020-12-28T07:41:26","modified_gmt":"2020-12-28T15:41:26","slug":"20201228-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20201228-00\/?p=104610","title":{"rendered":"Why is the HSHELL_WINDOWDESTROYED notification raised when a window is hidden, even if it hasn&#8217;t been destroyed?"},"content":{"rendered":"<p>The shell notification <code>HSHELL_<wbr \/>WINDOW\u00adCREATED<\/code> means that there is a new top-level unowned visible window. Conversely, <code>HSHELL_<wbr \/>WINDOW\u00adDESTROYED<\/code> means that a window is no longer a top-level unowned visible window. But these state changes can occur for reasons other than a window being created and destroyed. For example, if a top-level window hides itself, then that will generate a <code>HSHELL_<wbr \/>WINDOW\u00adDESTROYED<\/code> notification, even though no window was destroyed.<\/p>\n<p>Why don&#8217;t the names align with what they mean?<\/p>\n<p>These notifications were named while wearing taskbar-colored glasses.<\/p>\n<p>These notifications were created to assist the taskbar in keeping track of the windows in the system. The taskbar shows top-level unowned visible windows, so that&#8217;s what the notifications pay attention to. If you hide a top-level unowned window, it hasn&#8217;t been destroyed, but it may as well have been destroyed as far as the taskbar is concerned: The window disappears from the taskbar.<\/p>\n<p>Conversely, when the window becomes visible again, it gains a taskbar button. As far as the taskbar is concerned, it may as well have been newly-created.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Taskbar-colored glasses.<\/p>\n","protected":false},"author":1069,"featured_media":111744,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[25],"class_list":["post-104610","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>Taskbar-colored glasses.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/104610","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/users\/1069"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/comments?post=104610"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/104610\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media\/111744"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/media?parent=104610"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=104610"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=104610"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}