[TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
Moderators: Hacker, petermad, Stefan2, white
[TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
(This doesn't occur when using TC 32-bit)
(* Enable UAC if not enabled)
* Start TC 64-bit (restart if TC is already running)
* Go to a drive which needs admin right to change the volume label (normally your internal hard drive)
* Select menu Commands/Volume Label...
* Change the text of the volume label
* Click OK
* The error "Access denied on file" is displayed. Click "As administrator"
* The UAC message pops up asking for permission for the app to make changes to the system.
* Click "Yes" and quickly press the Esc key.
The volume label of the drive is changed, but the volume label displayed above the file panel is not changed.
Instead of pressing Esc, you can also click Cancel in the Set volume label dialog. You can easily test that by positioning the mouse cursor over the Cancel button, use the keyboard to confirm the volume label change and enable admin rights, click the Cancel button.
When you click the OK button this way you get 2 extra dialogs, one of which is never in dark mode. Screenshot
In my opinion, once OK or Cancel is chosen, it should not be possible to choose OK or Cancel in the same dialog again. Or it shouldn't do anything.
(* Enable UAC if not enabled)
* Start TC 64-bit (restart if TC is already running)
* Go to a drive which needs admin right to change the volume label (normally your internal hard drive)
* Select menu Commands/Volume Label...
* Change the text of the volume label
* Click OK
* The error "Access denied on file" is displayed. Click "As administrator"
* The UAC message pops up asking for permission for the app to make changes to the system.
* Click "Yes" and quickly press the Esc key.
The volume label of the drive is changed, but the volume label displayed above the file panel is not changed.
Instead of pressing Esc, you can also click Cancel in the Set volume label dialog. You can easily test that by positioning the mouse cursor over the Cancel button, use the keyboard to confirm the volume label change and enable admin rights, click the Cancel button.
When you click the OK button this way you get 2 extra dialogs, one of which is never in dark mode. Screenshot
In my opinion, once OK or Cancel is chosen, it should not be possible to choose OK or Cancel in the same dialog again. Or it shouldn't do anything.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
Not confirmed. I hammered on the ESC button like a fool after confirming the UAC dialog, but the label was re-read every time I tried.
Maybe it's a timing problem, but it sounds like you are dismissing the dialog with ESC, so TC only sees that you clicked cancel and doesn't re-read the label.
Maybe it's a timing problem, but it sounds like you are dismissing the dialog with ESC, so TC only sees that you clicked cancel and doesn't re-read the label.
I can try disabling the Cancel button while asking for elevation, but I see this as a minor problem.In my opinion, once OK or Cancel is chosen, it should not be possible to choose OK or Cancel in the same dialog again. Or it shouldn't do anything.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
Video pleaseghisler(Author) wrote: 2023-10-26, 09:26 UTC Not confirmed. I hammered on the ESC button like a fool after confirming the UAC dialog...

Correct, that seems to happen.ghisler(Author) wrote: 2023-10-26, 09:26 UTC Maybe it's a timing problem, but it sounds like you are dismissing the dialog with ESC, so TC only sees that you clicked cancel and doesn't re-read the label.
Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.ghisler(Author) wrote: 2023-10-26, 09:26 UTCI can try disabling the Cancel button while asking for elevation, but I see this as a minor problem.In my opinion, once OK or Cancel is chosen, it should not be possible to choose OK or Cancel in the same dialog again. Or it shouldn't do anything.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
OK, I will add that too.Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
Tested OK using TC 11.02rc5 64-bit, the label is now always re-loaded.history.txt wrote: 26.10.23 Fixed: Commands - Volume label: Disable Cancel button while asking for administrative rights (32/64)
The changelog mentions 32-bit as well, but 32-bit TC didn't have a problem.
Doesn't seem to be added, or the check for the flag is not done for the OK button. When the UAC prompt pops up and I select Yes using the keyboard and press Enter twice, I still get this:ghisler(Author) wrote: 2023-10-26, 09:58 UTCOK, I will add that too.Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.
white wrote: 2023-10-25, 18:12 UTC When you click the OK button this way you get 2 extra dialogs, one of which is never in dark mode. Screenshot
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
How do you do that? I cannot press Enter or click OK while the UAC dialog is up.When the UAC prompt pops up and I select Yes using the keyboard and press Enter twice
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
First Enter closes the UAC dialog. Second Enter activates the OK button.ghisler(Author) wrote: 2023-10-30, 13:56 UTCHow do you do that? I cannot press Enter or click OK while the UAC dialog is up.When the UAC prompt pops up and I select Yes using the keyboard and press Enter twice
So, it is not when the UAC dialog is up, but right after it was closed. Sorry, if that was not clear.
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
I see - that's not what I added when I confirmed "Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.". I now set a flag (ok clicked) when the user clicks on OK, so when he later sends cancel, it is still interpreted as OK.
What you describe here is trying to close the dialog again with OK when it has already been closed. The only way to prevent this is to disable the OK button too, just like the cancel button.
What you describe here is trying to close the dialog again with OK when it has already been closed. The only way to prevent this is to disable the OK button too, just like the cancel button.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
That certainly would do it. But why isn't it possible when OK is activated a second time to check the flag (ok clicked) and do nothing?ghisler(Author) wrote: 2023-10-30, 14:22 UTC I see - that's not what I added when I confirmed "Or set a flag when OK is clicked and check the flag when OK or Cancel is clicked again.". I now set a flag (ok clicked) when the user clicks on OK, so when he later sends cancel, it is still interpreted as OK.
What you describe here is trying to close the dialog again with OK when it has already been closed. The only way to prevent this is to disable the OK button too, just like the cancel button.
Out of curiosity: why does this only happen with 64-bit TC? Is this a Lazarus thing?
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
I don't know why it only happens in 64-bit. What happens is that TC gets a second "OK" event after the close event was already sent, so it tries to close the dialog box twice (which results in the white error message).
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
Can't you simply cancel the closing the second time around using the OnCloseQuery event?ghisler(Author) wrote: 2023-10-31, 08:22 UTC What happens is that TC gets a second "OK" event after the close event was already sent, so it tries to close the dialog box twice (which results in the white error message).
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
No, that doesn't seem to work, but setting the OnClick event of the OK button to nil seems to work.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- ghisler(Author)
- Site Admin
- Posts: 50390
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
This should be fixed in RC6, please test it!
30.10.23 Fixed: Commands - Volume label: Disable OK button while asking for administrative rights (32/64)
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.02rc4 64-bit] Cancel change volume label, but only the displayed label
Tested OK using TC 11.02rc6 32-bit and 64-bit.
Moderator message from: white » 2023-11-06, 16:03 UTC
Moved to Fixed bugs forum.