Holy cow, I wrote a book!
Sometimes you'll find a blank taskbar button that goes away when you click on it. What's the deal with that?
There are some basic rules on which windows go into the taskbar. In short:
(Though the ITaskbarList interface muddies this up a bit.)
When 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.
The blank buttons appear when a window changes between taskbar-eligible and taskbar-ineligible while it is visible. Follow:
This is why the documentation also advises, "If you want to dynamically change a window's style to one that doesn't support visible taskbar buttons, you must hide the window first (by calling ShowWindow with SW_HIDE), change the window style, and then show the window."
Bonus question: Why doesn't the taskbar pay attention to all windows as they come and go?