TC activates left tab after WM_COPYDATA with CD command

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

TC activates left tab after WM_COPYDATA with CD command

Post by *MVV »

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?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Hm-m, strange, in my test project it works instable - sometimes focus lefts in right panel but sometimes it jumps to left panel...
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

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. :)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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
Post Reply