February 2nd, 2009

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

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.

Topics
Code

Author

Raymond has been involved in the evolution of Windows for more than 30 years. In 2003, he began a Web site known as The Old New Thing which has grown in popularity far beyond his wildest imagination, a development which still gives him the heebie-jeebies. The Web site spawned a book, coincidentally also titled The Old New Thing (Addison Wesley 2007). He occasionally appears on the Windows Dev Docs Twitter account to tell stories which convey no useful information.

0 comments

Discussion are closed.