{"id":41283,"date":"2003-12-29T07:00:00","date_gmt":"2003-12-29T07:00:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/oldnewthing\/2003\/12\/29\/whats-with-those-blank-taskbar-buttons-that-go-away-when-i-click-on-them\/"},"modified":"2003-12-29T07:00:00","modified_gmt":"2003-12-29T07:00:00","slug":"whats-with-those-blank-taskbar-buttons-that-go-away-when-i-click-on-them","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/oldnewthing\/20031229-00\/?p=41283","title":{"rendered":"What&#039;s with those blank taskbar buttons that go away when I click on them?"},"content":{"rendered":"<p>Sometimes you&#8217;ll find a blank taskbar button that goes away when you click on it. What&#8217;s the deal with that?\nThere are <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/shellcc\/platform\/shell\/programmersguide\/shell_int\/shell_int_programming\/taskbar.asp\">some basic rules on which windows go into the taskbar<\/a>. In short:<\/p>\n<ul>\n<li>If the WS_EX_APPWINDOW extended style is set, then it will show (when visible).   <\/li>\n<li>If the window is a top-level unowned window, then it will show (when visible).   <\/li>\n<li>Otherwise it doesn&#8217;t show. <\/li>\n<\/ul>\n<p>(Though the <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/shellcc\/platform\/shell\/reference\/ifaces\/itaskbarlist\/itaskbarlist.asp\">ITaskbarList<\/a> interface muddies this up a bit.)\nWhen a taskbar-eligible window becomes visible, the taskbar creates a button for it. When a taskbar-eligible window becomes hidden, the taskbar removes the button.\nThe blank buttons appear when a window changes between taskbar-eligible and taskbar-ineligible <em>while it is visible<\/em>. Follow:<\/p>\n<ul>\n<li>Window is taskbar-eligible.   <\/li>\n<li>Window becomes visible ? taskbar button created.   <\/li>\n<li>Window goes taskbar-ineligible.   <\/li>\n<li>Window becomes hidden ? since the window is not taskbar-eligible at this point, the taskbar ignores it. <\/li>\n<\/ul>\n<p>Result: A taskbar button that hangs around with no window attached to it.\nThis is why the documentation also advises, &#8220;If you want to dynamically change a window&#8217;s style to one that doesn&#8217;t support visible taskbar buttons, you must hide the window first (by calling <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/winui\/winui\/windowsuserinterface\/windowing\/windows\/windowreference\/windowfunctions\/showwindow.asp\">ShowWindow<\/a> with SW_HIDE), change the window style, and then show the window.&#8221;\nBonus question: Why doesn&#8217;t the taskbar pay attention to <em>all<\/em> windows as they come and go?<\/p>\n<p>Answer: Because that would be expensive. The filtering out of windows that aren&#8217;t taskbar-eligible happens inside USER32 and it then notifies the taskbar (or anybody else who has installed a <a href=\"http:\/\/msdn.microsoft.com\/library\/en-us\/winui\/WinUI\/WindowsUserInterface\/Windowing\/Hooks\/HookReference\/HookFunctions\/ShellProc.asp%0D%0A\">WH_SHELL hook<\/a>) via one of the HSHELL_* notifications only if a taskbar-eligibie window has changed state. That way, the taskbar code doesn&#8217;t get paged in when there&#8217;s nothing for it to to. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you&#8217;ll find a blank taskbar button that goes away when you click on it. What&#8217;s the deal with that? There are some basic rules on which windows go into the taskbar. In short: If the WS_EX_APPWINDOW extended style is set, then it will show (when visible). If the window is a top-level unowned window, [&hellip;]<\/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":[104],"class_list":["post-41283","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-oldnewthing","tag-tipssupport"],"acf":[],"blog_post_summary":"<p>Sometimes you&#8217;ll find a blank taskbar button that goes away when you click on it. What&#8217;s the deal with that? There are some basic rules on which windows go into the taskbar. In short: If the WS_EX_APPWINDOW extended style is set, then it will show (when visible). If the window is a top-level unowned window, [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/41283","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=41283"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/posts\/41283\/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=41283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/categories?post=41283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/oldnewthing\/wp-json\/wp\/v2\/tags?post=41283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}