Is it possible to change TC DIR from a D5 App? YES [solved]

English support forum

Moderators: white, Hacker, petermad, Stefan2

User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

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

Post by *MVV »

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