Dark Mode on and off: different msgbox box sizes, copied style and translation

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *DrShark »

ghisler(Author) wrote: 2019-11-28, 11:26 UTCMaybe some other program is locking the clipboard
I tried with terminated PuntoSwitcher which monitored clipboard, but issue still happens. Also instead of pasting the text to some editor I tried to check clipboard content with Windows NT ClipBook Viewer (clipbrd.exe): there I see that sometimes when I press Ctrl+C on active msgbox window first time, clipboard content is not updated. Since there is no beep at this moment too, it looks like msgbox window sometimes fails to catch first Ctrl+C keypress. Right now I don't know what can I do to get more information on the issue. Is there any way to make sure Ctrl+C reaches TC's msgbox window?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *ghisler(Author) »

The check for ctrl+c is very simple: on OnKeyup of the form, I call:

Code: Select all

if (key=ord('C')) and (Shift=[ssCtrl]) then begin
Maybe some other modifier keys like Shift or Alt were still pressed?
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *DrShark »

I can reproduce this Ctrl+C fails even after PC reboot. In email I asked to add some logging on this, but it silently goes to Behavior will no be changed now... Well... In that email I also wrote that system msgbox supports text copy by Ctrl+Ins, and it doesn't work with dark msgboxes of Total Commander.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *ghisler(Author) »

Maybe it's Vista-specific? I will have to make some tests on Vista...
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *DrShark »

I can reproduce dark msgbox copy fail problem on 3 notebooks with different Windows (32-bit Vista and 7, 64-bit Windows 10) with both classic and aero themes, using both 32-bit and 64-bit Total Commander.

It seems it's easier to reproduce it if to press Ctrl+C with one hand. It's really strange that even this way Christian Ghisler cannot reproduce it on any of his PCs.

So I need help with reproducing it from other users. Try following test case:
1. Start TC in dark mode.
2. Open some file in (like history.txt) Lister
3. Either open some text editor, or launch some clipboard watcher like clipbrd.exe (this tool isn't part of modern Windows, but it's possible to download it from Internet and use there).
4. (optional) use some keylogger like Carnac tool mentioned in this topic.
5. In Lister, press Ctrl+F, enter some random characters, press Enter.
6. When "Not found" dark msgbox will appear, press Ctrl+C using fingers of left hand, close msgbox with Esc or Enter.
Repeat steps 5 and 6 several times.
If after Ctrl+C sometimes you can't hear a beep, and you don't use clipboard monitoring tool, you can paste text to some editor to make sure current message box text wasn't copied.

If you can confirm sometimes dark msgbox text is not copied, you can also try some other tests with left-handed Ctrl+C:
a) In Lister's Ctrl+F dialog, after entering random characters, select them and copy with Ctrl+C using left hand.
Repeat this many times: new entered text should always appear in clipboard.
b) Select random parts of text in file opened in Lister and copy with Ctrl+C using left hand: selected text should always appear in clipboard.
c) switch TC to regular theme (disable dark mode), try main test case may times with system "Not found" msgbox: new msgbox text should always appear in clipboard after copying it with Ctrl+C using left hand.

If everything goes as described above, please write here. Would be nice to find if any additional factor is required to reproduce the problem, if such exists.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *petermad »

1. Start TC in dark mode.
2. Open some file in (like history.txt) Lister
3. Either open some text editor, or launch some clipboard watcher like clipbrd.exe (this tool isn't part of modern Windows, but it's possible to download it from Internet and use there).
4. (optional) use some keylogger like Carnac tool mentioned in this topic.
5. In Lister, press Ctrl+F, enter some random characters, press Enter.
6. When "Not found" dark msgbox will appear, press Ctrl+C using fingers of left hand, close msgbox with Esc or Enter.
Repeat steps 5 and 6 several times.
If after Ctrl+C sometimes you can't hear a beep, and you don't use clipboard monitoring tool, you can paste text to some editor to make sure current message box text wasn't copied.

If you can confirm sometimes dark msgbox text is not copied, you can also try some other tests with left-handed Ctrl+C:
a) In Lister's Ctrl+F dialog, after entering random characters, select them and copy with Ctrl+C using left hand.
Repeat this many times: new entered text should always appear in clipboard.
b) Select random parts of text in file opened in Lister and copy with Ctrl+C using left hand: selected text should always appear in clipboard.
c) switch TC to regular theme (disable dark mode), try main test case may times with system "Not found" msgbox: new msgbox text should always appear in clipboard after copying it with Ctrl+C using left hand.
I can reproduce all of this in TC 9.5b11 32bit and 64 bit, so far tested under Windows 7 x64 w. aero theme, Windows 10 1909 x64 w. standard theme and Windows XP x86 w. luna theme.

But I can only reproduce it reliably if I press the Ctrl and the C key at exactly the same time (one hand).
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *ghisler(Author) »

2petermad
Does Ctrl+C work for you in the search results (Alt+F7, do a search, Ctrl+C)?
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *petermad »

Does Ctrl+C work for you in the search results (Alt+F7, do a search, Ctrl+C)?
Yes, every time also in Dark mode and also if I press Ctrl and C at exactly the same time.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *DrShark »

petermad wrote: 2020-01-03, 22:33 UTCI can only reproduce it reliably if I press the Ctrl and the C key at exactly the same time (one hand).
I can confirm it. Can you also reproduce dark message box copy fail if to press Ctrl+C in "jump" way with one hand:

push Ctrl, don't release yet fully but also don't push Ctrl, press C, release Ctrl, release C

(so basically you're pressing C while releasing Ctrl)?
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *petermad »

push Ctrl, don't release yet fully but also don't push Ctrl, press C, release Ctrl, release C

(so basically you're pressing C while releasing Ctrl)?
I can confirm this too, in Dark mode. In Normal mode the message box copy works no matter whether you release Ctrl or C first.

It simply seems that in Normal mode there is listened for a keydown event and in Dark mode for a keyup event (or a keypress event) for the C keypress
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *ghisler(Author) »

I see - I'm indeed checking for Ctrl+C in the "key up" event and not the "key down" event. Since you release Ctrl before C, GetKeyState returns "not pressed" for Ctrl. I will move it to the "key down" event in beta 12. I will also add a check for Ctrl+Insert.
Author of Total Commander
https://www.ghisler.com
User avatar
petermad
Power Member
Power Member
Posts: 14739
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *petermad »

08.01.20 Fixed: Dark mode: Ctrl+C in message box now handled in "key down" event instead of "key up" event (32/64)
Confirmed in TC 9.5b12 :-)
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50b4 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *DrShark »

ghisler(Author) wrote: 2020-01-08, 11:31 UTCin beta 12. I will also add a check for Ctrl+Insert.
I can confirm Ctrl+Ins as been added in TC 9.50 beta 12 as a way to copy dark msgbox text.
history950.txt wrote:08.01.20 Fixed: Dark mode: Ctrl+C in message box now handled in "key down" event instead of "key up" event (32/64)
I can confirm this fixes "jump way" copy (it works good for both Ctrl+C and Ctrl+Ins).
petermad wrote: 2020-01-03, 22:33 UTCBut I can only reproduce it reliably if I press the Ctrl and the C key at exactly the same time (one hand).
If by "press the Ctrl and the C key at exactly the same time" we mean not pressing C while holding Ctrl, but actually pushing both Ctrl and C together, it fails in both dark and system msgbox (even though system one beeps, but on beeps see below note), so maybe this cannot be fixed.

Regarding beeps: it seems system msgbox reacts with beep to many keys (except some like single Ctrl or Insert key) no matter whether text is actually copied to clipboard, which means it always beeps on Ctrl+C and never on Ctrl+Ins. Total Commander's dark msgbox beeps when putting text to clipboard (both with Ctrl+C and Ctrl+Ins) which is better I think.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Re: Dark Mode on and off: different msgbox box sizes, copied style and translation

Post by *ghisler(Author) »

OK, thanks for your feedback - finally this has been resolved. I will leave it as it is now.
Author of Total Commander
https://www.ghisler.com
Post Reply