Is it possible to change TC DIR from a D5 App? YES [solved]
Moderators: white, Hacker, petermad, Stefan2
- ghisler(Author)
- Site Admin
- Posts: 48232
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Just the "S" flag? That shouldn't change the panel, only when combined with "L" or "R" flag...
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
I'm trying to change directory from my VirtualPanel to archive when user presses Shift+Enter. When I call SendMessage in main thread, TC acts strange - opens archive in new tab, and then goes one dir up and sets focus to "..". So, I create buffer with WM_COPYDATA and data and then call CreateThread and pass to that function address of allocated buffer. Started function from another thread calls SendMessage and frees buffer memory then.
OK, I found bug reason - if I count zero byte after flags, all works fine. But if I specify in cbData of COPYDATASTRUCT ammount of bytes that ends after flags immediately (I don't call zero byte), it seems that Windows doesn't pass it to TC and TC reads garbage after buffer while searching for flags - and in most of cases sets focus to left panel.
OK, I found bug reason - if I count zero byte after flags, all works fine. But if I specify in cbData of COPYDATASTRUCT ammount of bytes that ends after flags immediately (I don't call zero byte), it seems that Windows doesn't pass it to TC and TC reads garbage after buffer while searching for flags - and in most of cases sets focus to left panel.