Search code examples
c++winapiwindows-7progress-bartaskbar

What could prevent TBPF_INDETERMINATE progress bar from being displayed in taskbar?


I'm trying to implement the new Windows 7 taskbar progress bar. I managed to get it to work with TBPF_NORMAL state using the following code:

CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&taskbarList));

HRESULT c = taskbarList->SetProgressState(hWnd, TBPF_NORMAL);
if (c != S_OK) MessageBox("ERROR");
taskbarList->SetProgressValue(hWnd, 5, 10);

However if I try the exact same code with TBPF_INDETERMINATE, it doesn't display anything and there's no error either:

CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARGS(&taskbarList));

HRESULT c = taskbarList->SetProgressState(hWnd, TBPF_INDETERMINATE);
if (c != S_OK) MessageBox("ERROR");

Does anybody know what could be causing this problem?


Solution

  • Okay, it looks like it was a problem with the configuration of my system. I post the answer here because it's not obvious why one progress bar animation would work but not another.

    In System Properties / Performance Options, I had "Animations in the taskbar and Start Menu" disabled. This option apparently disables the "indeterminate" animation but not the regular one. By re-enabling the option, the indeterminate animation works.