{"id":110393,"date":"2024-10-21T07:00:00","date_gmt":"2024-10-21T14:00:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/oldnewthing\/?p=110393"},"modified":"2024-10-21T12:51:23","modified_gmt":"2024-10-21T19:51:23","slug":"20241021-00","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20241021-00\/?p=110393","title":{"rendered":"Why does adding <CODE>WS_<WBR>MINIMIZE&shy;BOX<\/CODE> change how my window behaves when the user presses <KBD>Win<\/KBD>+<KBD>D<\/KBD>?"},"content":{"rendered":"<p>A customer noticed that if they add the <code>WS_<wbr \/>MINIMIZE\u00adBOX<\/code> style to their window, then the <code>IsIconic<\/code> function returns a nonzero value after the user presses <kbd>Win<\/kbd>+<kbd>D<\/kbd>. But if they remove the <code>WS_<wbr \/>MINIMIZE\u00adBOX<\/code> style, then then the <code>IsIconic<\/code> function always returns <code>FALSE<\/code>. What&#8217;s going on?<\/p>\n<p>We learned some time ago that <a title=\"What is the difference between Minimize All and Show Desktop?\" href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20040527-00\/?p=39153\"> the Show Desktop command <kbd>Win<\/kbd>+<kbd>D<\/kbd> first minimizes all windows that can be minimized, and then moves the desktop window to the top of the z-order<\/a>.<\/p>\n<p>Therefore, the described behavior is expected: If the window has the <code>WS_<wbr \/>MINIMIZE\u00adBOX<\/code> style, then it can be minimized, so the Show Desktop command minimizes it, and the <code>IsIconic<\/code> function reports that the window is indeed minimized. On the other hand, if the the style is missing, then the window cannot be minimized, so the <code>IsIconic<\/code> function reports that the window is not minimized.<\/p>\n<p><b>Bonus chatter<\/b>: But why is the function called <code>IsIconic<\/code> when it really reports on whether the window is minimized? Shouldn&#8217;t it be called <code>IsMinimized<\/code>? What is an &#8220;iconic&#8221; window anyway? Is it a window that is <a href=\"https:\/\/dictionary.cambridge.org\/dictionary\/english\/iconic\"> widely recognized as representative for its era<\/a>?<\/p>\n<p>No. The reason is simple: Before the taskbar was invented, <a title=\"Where did windows minimize to before the taskbar was invented?\" href=\"https:\/\/devblogs.microsoft.com\/oldnewthing\/20041028-00\/?p=37453\"> minimized windows were represented by an icon<\/a>. So the name &#8220;is iconic&#8221; was correct at the time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It minimizes your window if it can.<\/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-110393","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-code"],"acf":[],"blog_post_summary":"<p>It minimizes your window if it can.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/110393","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=110393"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/110393\/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=110393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=110393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=110393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}