How do I programmatically show and hide the Quick Launch bar?

Raymond Chen

Commenter Mihai wants to know how to show or hide the Quick Launch bar programmatically.

That’s not something a program should be doing. Whether the Quick Launch bar is shown or hidden is an end user setting, and programs should not be overriding the user’s preferences. Explorer consciously does not expose an interface for showing and hiding taskbar bands because it would just be a target for abuse. Much like the program that wants to uninstall other programs, the taskbar would become a battleground among programs that each wanted to force themselves on and force their opponents off.

The user is the arbiter of what goes into the Taskbar.

I’m told that Windows Vista added a new ITrayDeskBand interface that does indeed let you turn taskbar bands on and off. (I don’t know whether it works for Quick Launch. Heck, I don’t even know if it works at all! Not my area of expertise.) The story I heard was that so many programs were doing exactly what they shouldn’t be doing—namely forcing their feature on, overriding the user’s preference—that the Taskbar folks decided, “If you can’t stop people from doing a bad thing, at least make them do the bad thing under your supervision. That way you have just one evil thing to support instead of everybody’s home-grown undocumented hack.” It’s sort of the Taskbar Needle Exchange Program.