Please post a small project demonstrating the issue.
It is the
shelltreeview_custom.zip as found in
https://forum.lazarus.freepascal.org/index.php/topic,61347.msg462091.html#msg462091.
Just replaced the last begin-end part of the original procedure
TCustomShellTreeView.DoSelectionChanged; with this one :
procedure TCustomShellTreeView.DoSelectionChanged;
...
begin
showmessage(CurrentNodePath); // OK
// if not FileExistsUtf8(CurrentNodePath) then // commented out for test
if not FileExists(CurrentNodePath) then // but same bad result
Raise EShellCtrl.CreateFmt(sShellCtrlsSelectedItemDoesNotExists,[CurrentNodePath]);
if Assigned(Anode.Parent) then
FShellListView.Root := GetPathFromNode(ANode.Parent)
else
FShellListView.Root := '';
end;
end;
end;
and then, after reading the TRon post, simply comment out the
if not FileExists(CurrentNodePath) then
line and add below
if not DirectoryExists(CurrentNodePath) then // new, better
Now it runs OK but with strange results : after F9 I see one ShowMessage with the ShellTreeview.root string but anywhere else I click I don't see other ShowMessage.
If I click on 6_fonts_Vista folder, I don't see a sorted result.
If I ask Linux to sort by name in the pcmanfm ExplorerFile, of course the result begins with calibri.ttf (bottom of img, "6_fonts_Vista"), but it is not or badly sorted in the top window ("Form1") from shelltreeview_custom.zip.
It is after all a directory not a file ?
I remember that sentence, "in Linux everything is file".
After all, a directory is just a special file, isn't it ?
Regards,