What to return in FsFindFirst in this case?

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

What to return in FsFindFirst in this case?

Post by *djorge »

When a user has the cursor on a file on the panel plugin and presses CTRL+LEFT ARROW or CTRL+RIGHT ARROW, TC shows the child of all the current item on the oposite pannel.

But what if the user has pressed this key combination on a file? What should the plugin return to TC in FsFindFirst in this case?

In my current implementation i am returning INVALID_HANDLE_VALUE which causes TC to show the "C:\". I don't like this behavior. Is there anything i can do to modify this behavior?
______________________
David Jorge
Personal License #117854
CoolWater
Power Member
Power Member
Posts: 744
Joined: 2003-03-27, 16:33 UTC

Post by *CoolWater »

Hello,

how about returning the handle to the first file in the current dir? Then, TC should show the same dir in the other panel. TC behaves the same way on normal files...

Regards,
CoolWater
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge »

Good ideia! :oops:
______________________
David Jorge
Personal License #117854
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge »

Can someone explain me why when i press CTRL+LEFT/RIGHT in a file FSFindFirst(Path,....) is called with the file appended in the Path variable?

Suppose i have in my filesystem \\DIR_A\File1. In that case Path="\DIR_A\File1".

In the fssampleplugin, when i press CTRL+LEFT/RIGHT FSFindFirst is called with Path="\DIR_A" without the file name appended.

How TC takes he decision to call FSFindFirst with the file appended in the Path variable?

I am already returning the handle to the first file in the current dir as suggested, but with this behavior the other pannel thinks that is in \DIR_A\File1 which is a problem. It show the contents of \DIR_A, but TC thinks it is in \DIR_A\File_1 and if i try to go back a dir, FSFindFirst is called with Path="\DIR_A" instead of Path="\". :?
______________________
David Jorge
Personal License #117854
djorge
Senior Member
Senior Member
Posts: 422
Joined: 2003-07-03, 12:48 UTC
Location: Portugal

Post by *djorge »

I figured out how to solve the problem. If the file has size 0 TC somehow thinks it is a Directory and calls FSFindFist with the file appended in path variable. If the size is greater than 0, FSFindFirst is called without the file appended in the Path.

IMHO this is not how TC should handle this. Why TC doesn't check if it is a Directory or an Archive? Anyway, problem solved :).

BTW, now there is no need to return an handle to the first file in the current dir...
______________________
David Jorge
Personal License #117854
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50421
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Ah, thanks for the info - I will check where the problem is.
Author of Total Commander
https://www.ghisler.com
Post Reply