Internationalization Cookbook
This is my personal blog. The views expressed on these pages are mine alone and not those of my employer.

TaskBarCmd – programmatically change the Windows Taskbar settings

This is a small tool that was not supposed to be public, but somehow people did manage to find out about it. And once in a while I get requests for it.

So here it is!

Story

A while ago some of the MVP colleagues needed a way to automatically manipulate the Windows taskbar. Simple stuff: hide/show the taskbar, set the “keep on top” option. I don’t remember if showing the “Quick Launch” toolbar was also part of the request, or it was my idea (because my XP sometimes hides the “Quick Launch” after reboot).

Because nobody was able to find out a solution, I decided it is an interesting thing to dig into, and I have managed to put together a small tool doing that.

I have posted it somewhere on my web site, in a non-public place, and deleted it after a short while. End of story. Or this is what I have thought :-)

Why not public?

Because I cannot promise that it will work ok on any system. An because there is something in that code that I don’t like.

To show/hide the “Quick Launch” toolbar I am using the IBandSite interface. And then I show (or hide) the first band number 10. But I don’t know this is true on all systems! I could compare the band name to “Quick Launch,” but this is also a problem on localized systems.

So for me the code is incomplete, and nothing to make public.

But hey, you ask for it. And in fact it might even work on all systems.

And if you can find a documented way to know for sure that the band I am changing is indeed the “Quick Launch,” I would appreciate if you tell me. And I I will give you credit, then update the tool and the code!

Disclaimers

  • I am not responsible if this hides the toolbar, hides your processor, your computer or your house.
  • I am not responsible if you take this code and use it in your application to annoy users
  • In general, I am irresponsible! :-)

Download

Ok now, there you go:

Good luck!

2 Comments to “TaskBarCmd – programmatically change the Windows Taskbar settings”

  1. Alex says:

    Yeah, using fixed QUICKLAUNCH_BANDID=10 sure doesn’t work, so need to use EnumBands interface to find “Quick Launch”:

    UINT uBand = 0;
    DWORD dwBandID;

    // Find “Quick Launch” band in a band site
    while ((hRez = pBandSite->EnumBands(uBand, &dwBandID)) == S_OK)
    {
    hRez = pBandSite->QueryBand(uBand, &pBand, &dwOrgState, bufName, _countof(bufName));
    if (std::wstring(bufName) == L”Quick Launch”)
    break;
    uBand++;
    }

    • Mihai says:

      Thank you, your solution might help someone.
      I thought about it, but it kind of goes against what I am doing with this site, because it only works for English :-)

Leave a comment