[TC 11.00b4] Right arrow not working when renaming a file
Moderators: Hacker, petermad, Stefan2, white
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.00b4] Right arrow not working when renaming a file
If the plugins use WH_CALLWNDPROC and don't pass all messages on to Total Commander, then it will miss some key presses and will lose track of the cursor position...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- unter_officer
- Junior Member
- Posts: 19
- Joined: 2022-08-11, 13:32 UTC
Re: [TC 11.00b4] Right arrow not working when renaming a file
2ghisler(Author)
These plugins have been around for a long time. But the problems started in the 3rd beta TC. Before that, there were no problems.
Probably something has changed in the TC code that causes a conflict.
These plugins have been around for a long time. But the problems started in the 3rd beta TC. Before that, there were no problems.
Probably something has changed in the TC code that causes a conflict.
«The Truth Is Out There»
Re: [TC 11.00b4] Right arrow not working when renaming a file
This doesn't explain why the newfound problem is only in the positions to the left of the first two characters.ghisler(Author) wrote: 2023-05-30, 09:12 UTC it will miss some key presses and will lose track of the cursor position...
The bug is reproduced even if you run an empty hook, which does nothing at all, but simply transfers control to the next one in the chain:
Code: Select all
LRESULT __stdcall CallWindowProcProc(int nCode, WPARAM wParam, LPARAM lParam)
{
return CallNextHookEx(hCWPHookID, nCode, wParam, lParam);
}
...
if (!hCWPHookID)
hCWPHookID = SetWindowsHookEx(WH_CALLWNDPROC, &CallWindowProcProc, 0, GetWindowThreadProcessId(TCWnd, NULL));
Overquoting is evil! 👎
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.00b4] Right arrow not working when renaming a file
The main change between beta 2 and 3 was to call SendMessageW instead of SendMessage on NT based systems for the functions EM_GETSEL, EM_SETSEL, and GetWindowTextW to get the control text. I'm also calling CharPrevW and CharNextW instead of CharPrev and AnsiNext to move the cursor. This is necessary to properly support Unicode characters.
Especially EM_GETSEL returns the position of the selection or cursor in Unicode characters. I can't see a reason how a simple CallNextHookEx could interfere here, there is no CallNextHookExW to my knowledge.
Especially EM_GETSEL returns the position of the selection or cursor in Unicode characters. I can't see a reason how a simple CallNextHookEx could interfere here, there is no CallNextHookExW to my knowledge.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.00b4] Right arrow not working when renaming a file
2ghisler(Author)
But you can test on the 32-bit version, right?
But you can test on the 32-bit version, right?
Overquoting is evil! 👎
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.00b4] Right arrow not working when renaming a file
Yes, I have now debugged it, and found something interesting: It's indeed happening only while TWinkey is running!
When it was running, GetWindowTextW was returning an empty string. This seems to be due to a bug in the length field: It should contain the size of the widechar array in characters, but it was sent the size in bytes. Strangely it had no effect when TWinkey wasn't running, then GetWindowTextW returned the string just fine. Changing the size parameter to the right value seems to have fixed the problem. There was no buffer overflow, the used buffer was 4096 wide char characters large. The error was introduced when converting from ANSI to Unicode functions.
When it was running, GetWindowTextW was returning an empty string. This seems to be due to a bug in the length field: It should contain the size of the widechar array in characters, but it was sent the size in bytes. Strangely it had no effect when TWinkey wasn't running, then GetWindowTextW returned the string just fine. Changing the size parameter to the right value seems to have fixed the problem. There was no buffer overflow, the used buffer was 4096 wide char characters large. The error was introduced when converting from ANSI to Unicode functions.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: [TC 11.00b4] Right arrow not working when renaming a file
This is good news. I believe this will fix the problem when using SetMessageAction in autorun. Or has it not been checked yet?ghisler(Author) wrote: 2023-05-30, 20:45 UTC Changing the size parameter to the right value seems to have fixed the problem.
Overquoting is evil! 👎
- ghisler(Author)
- Site Admin
- Posts: 50421
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: [TC 11.00b4] Right arrow not working when renaming a file
It should fix that too, we will see soon...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
- unter_officer
- Junior Member
- Posts: 19
- Joined: 2022-08-11, 13:32 UTC
Re: [TC 11.00b4] Right arrow not working when renaming a file
Fixed in TC 11.00 beta 5.
Thank you!
Thank you!
«The Truth Is Out There»