Page 1 of 1

ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-03-26, 01:36 UTC
by anserk
I would like to bring up an issue that was reported earlier (viewtopic.php?t=80109) but was closed due to lack of details.

Basically, when a file is copied, the progress state of the taskbar icon remains in 0% state. This issue is only seen when using a third-party taskbar called RetroBar, probably because it changes the taskbar text instead of an actual progress bar, where a 0% would likely not be seen either way. After the post above was closed, the RetroBar developer provided more information (from https://github.com/dremin/RetroBar/issues/686):
While it is true that Total Commander is setting the TBPF_NOPROGRESS state, it then immediately after sets a TBPF_NORMAL state, which causes 0% to appear in RetroBar. We can see this in the last two lines of the RetroBar debug logs:

Code: Select all

[10/22/2023 6:58:53 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 2
[10/22/2023 6:58:53 PM] Debug: TasksService: ITaskbarList: SetProgressValue HWND:658880 Progress: 8520
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 2
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressValue HWND:658880 Progress: 20971
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 2
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressValue HWND:658880 Progress: 28179
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 2
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressValue HWND:658880 Progress: 37354
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 2
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressValue HWND:658880 Progress: 45873
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 2
[10/22/2023 6:58:54 PM] Debug: TasksService: ITaskbarList: SetProgressValue HWND:658880 Progress: 52426
[10/22/2023 6:58:55 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 2
[10/22/2023 6:58:55 PM] Debug: TasksService: ITaskbarList: SetProgressValue HWND:658880 Progress: 55703
[10/22/2023 6:58:55 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 2
[10/22/2023 6:58:55 PM] Debug: TasksService: ITaskbarList: SetProgressValue HWND:658880 Progress: 64222
[10/22/2023 6:58:55 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 0
[10/22/2023 6:58:55 PM] Debug: TasksService: ITaskbarList: SetProgressState HWND:658880 Flags: 2
I can also reproduce it every single time and see in the RetroBar logs that Total Commander sets TBPF_NORMAL (0x00000002) flag. If I understand correctly (based on https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-itaskbarlist3-setprogressstate), no other flag should be set after TBPF_NOPROGRESS (0x00000000).

I realize this might be a very uncommon combination of using both Total Commander and RetroBar, but at the same time if TBPF_NORMAL is incorrectly being set in the code indeed, I feel like fixing it would be the right thing to do even if only a fraction of users are impacted.

I appreciate your time on this. I have been a loyal Total Commander user since 2000 and really want my favourite tool TC to look spotless. On a side note, I really, really appreciate that TC keeps its original look and extremely well thought-out design. In the current age of "flashy looks trumps functionality", it remains a true gem after all these years.

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-03-26, 10:36 UTC
by AntonyD
I can confirm on the regular standard Windows taskbar tied to the explorer.exe process that when I try to copy/move large volumes of small files,
all I see in the minimized process's button's label on this panel is "0% and the fixed file name of some file".
And it doesn’t matter how long the copying process takes.
Those even if there is a minute more time, this zero percent does not change even by 50 or is not equal to 100 percent at the end of the work.
So there is no connection to the non-standard taskbar.

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-03-29, 14:12 UTC
by ghisler(Author)
So what do you expect me to do? Shouldn't this be fixed by the author of RetroBar?

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-03-29, 14:35 UTC
by AntonyD
2ghisler(Author)
As I said - this problem does exist for the STANDARD windows taskbar)))

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-04-01, 14:14 UTC
by ghisler(Author)
When exactly do you see Total Commander setting TBPF_NORMAL? It should only be set during a file operation.

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-04-02, 03:35 UTC
by anserk
Christian, if you step through the debug mode for something like a small file copy, do you ever see TBPF_NORMAL being set after TBPF_NOPROGRESS? Maybe if you could set breakpoints on any line in the code that sets TBPF_NORMAL and see if it is being called in the wrong order.

Unfortunately, ITaskbarList3 doesn't provide any "get" methods, so it's impossible for me to query the state from outside of the program itself to confirm one way or the other without relying on RetroBar logs. There are many programs that provide taskbar progress status, and everything else I'm using doesn't have this issue with RetroBar.

If you can confirm for sure that TBPF_NORMAL is never called after TBPF_NOPROGRESS, this case can be closed then.

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-04-02, 07:23 UTC
by AntonyD
2anserk
If you can confirm for sure that TBPF_NORMAL is never called after TBPF_NOPROGRESS, this case can be closed then.
Why do you so easily agree that the bug exists and is being reproduced - but if it simply says that one flag is called after another, then that’s ok?
In the button of the minimized Total to the taskbar, as was shown before, only 0% will remain shown during the copying process.
This is the essence of the bug!

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-04-03, 02:05 UTC
by anserk
2AntonyD
I'm not sure we are talking about the same bug. I don't have the 0% during the copy, the progress is shown correctly for all operations. It's set to 0% only after the operation is completed and remains that way until TC restart.
I'm not trying to prove anyone wrong, I simply want to get to the root cause of the issue and have it fixed. If this issue is in TC code, then what I suggested above will clearly show it.

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-04-03, 05:23 UTC
by AntonyD
I don't have the 0% during the copy, the progress is shown correctly for all operations. It's set to 0% only after the operation is completed and remains that way until TC restart.
Maybe you could do the small video about this "progress"? pls?
Coz I slightly doubt that we can have a similar but not an identical bugs here...

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-04-12, 10:17 UTC
by ghisler(Author)
I have checked this now, and indeed I'm calling "the operation is done" before "un-pause the operation", so that second call sets the taskbar back to TBPF_NORMAL after it was set to TBPF_NOPROGRESS. I will correct it.

Re: ITaskbarList SetProgressState is setting a wrong flag upon completion

Posted: 2024-04-13, 17:51 UTC
by anserk
I appreciate you taking time to look into it. Thank you for continuously improving Total Commander!