TC activates left tab after WM_COPYDATA with CD command
Moderators: Hacker, petermad, Stefan2, white
TC activates left tab after WM_COPYDATA with CD command
When I send to TC window WM_COPYDATA message with CD command to set active paths in TC panels, TC always sets focus to left tab, even if right one was focused before. So, when I use "S" flag, path changes for right panel but focus jumps to left. May this be fixed?
- ghisler(Author)
- Site Admin
- Posts: 50406
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
I'm not aware of this problem. Does anyone have a simple script (autohotkey or so) to test this?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I tested it and found a way to solve problem (explained here). I don't know is a bug but I think TC should not read more bytes than specified in cbData field of COPYDATASTRUCT - or it may cause even page faults in some cases. But if buffer have trailing zero byte, all work fine. 

- ghisler(Author)
- Site Admin
- Posts: 50406
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Ah, thanks for your tests! Indeed TC needs this terminating 0 byte. The cbData field is essential, it tells Windows how much data it needs to copy from the source process to the target process. WM_COPYDATA is the only message I know of which can do this. When you give a number which is too small, Windows will only copy that number of bytes.
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com