Support ESC to cancel Copy to a phone

Here you can propose new features, make suggestions etc.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Slavic
Senior Member
Senior Member
Posts: 290
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Support ESC to cancel Copy to a phone

Post by *Slavic »

Please add the support of the ESC key to cancel a copy operation to/from external USB device, e.g. smartphone. Currently only [ No ] button in this dialog works, but no ESC key, nor [x] in the top right corner. Using ESC is very traditional, and lack of it here is unexpected and sad.
Desktop: Windows 11 Pro 23H2, TC 11.03(RC). Mobile: Pixel 5a, Android 14, TC 3.42b5
Slavic
Senior Member
Senior Member
Posts: 290
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Re: Support ESC to cancel Copy to a phone

Post by *Slavic »

I have done some searches of this dialog, here are the results.

To show the dialog for copy to/from USB device, TC uses the Win32 API function MessageBox(), which is a simple function to show the short message on the screen, by default in the centre of screen (you can notice the difference from "normal" Copy/Move dialog, which is shown in the centre of TC window). As described in MSDN, MessageBox has some parameters, the last of them is uType, which defines the look of message window and its buttons.

It seems that currently TC calls this function with the uType value MB_YESNO, which shows the buttons [ Yes ] and [ No ], but ignores the [ x ] in the top right corner (it is disabled) as well as Esc key. To enable them, need to use any other value of uType which shows the button [ Cancel ], for example, MB_OKCANCEL. In such case, dialog will show the buttons [ OK ] and [ Cancel ] instead, and Esc will work as expected, closing the dialog like Cancel. The dialog's functionality will remain the same, also the button names will be in line with the buttons in other TC dialogs.
Desktop: Windows 11 Pro 23H2, TC 11.03(RC). Mobile: Pixel 5a, Android 14, TC 3.42b5
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Support ESC to cancel Copy to a phone

Post by *MVV »

Well, it is not only TC who uses Yes-No logic because it is more human-readable than Ok-Cancel (compare "Do you want to do something? Yes-No" and "You are going to do something. Ok-Cancel"), especially if the only reason of the latter is closing by Esc. And there are more cases in TC when Yes-No dialogs are used (e.g. buttonbar button deletion confirmation).

You can try my tiny NoClose library from this post, it allows closing Yes-No dialogs by Esc, I use it for years and forgot about this annoyance.
Slavic
Senior Member
Senior Member
Posts: 290
Joined: 2006-02-26, 15:41 UTC
Location: Montenegro

Re: Support ESC to cancel Copy to a phone

Post by *Slavic »

Thanks for this suggestion, MVV, but no. It should work similarly for everyone, not only for me. Yes, there may be the situations where the buttons Yes and No are really important because a user should answer the question of critical importance, so allowing to simply close this dialog by Esc would not be a good choice. Because of this, MB_YESNO option should exist and work as the API creators made. Of course, cancelling of the file copy to USB device isn't such case, it should look in line with other Copy/Mode TC dialogs, where the buttons [ OK ] and [ Cancel ] are traditionally used and where Esc works as expected.

As a UI tester (in some other projects) I always try to look at UI from the point of ordinary user, where the common default approach and similarity play important role. I try to forget my professional level and sometimes may ask obvious and maybe silly questions, all for the sake of the future end user.
Desktop: Windows 11 Pro 23H2, TC 11.03(RC). Mobile: Pixel 5a, Android 14, TC 3.42b5
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: Support ESC to cancel Copy to a phone

Post by *MVV »

I understand your point of view but you can't ask every software developer to fix all dialogs, and there is a solution that already works for now. :)
Unfortunately standard Yes-No message boxes don't have any option to close by Esc, though TC may add a hook itself, so it will work for all users.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Support ESC to cancel Copy to a phone

Post by *ghisler(Author) »

The problem is that this isn't even Total Commander's dialog - copying from/to virtual folders goes via Copy+Paste, which is a part of Windows itself.
Author of Total Commander
https://www.ghisler.com
Post Reply