By default a "normal" visible un-owned window gets a taskbar button and the taskbar button is visible in every state except SW_HIDE
.
MSDN also documents a couple of tricks you can use to override the button:
The Shell creates a button on the taskbar whenever an application creates a window that isn't owned. To ensure that the window button is placed on the taskbar, create an unowned window with the WS_EX_APPWINDOW
extended style. To prevent the window button from being placed on the taskbar, create the unowned window with the WS_EX_TOOLWINDOW
extended style. As an alternative, you can create a hidden window and make this hidden window the owner of your visible window.
... If you want to dynamically change a window's style to one that does not 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.
Another alternative is to use the ITaskbarList
interface, it gives you full control over your taskbar button.