Develop Delphi: How to set cursor to file?

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
cadsky
Junior Member
Junior Member
Posts: 2
Joined: 2016-01-08, 10:34 UTC

Develop Delphi: How to set cursor to file?

Post by *cadsky »

How set cursor to specific file in directory from Delphi?

Code: Select all

procedure SelectFile('Export.txt')
begin
   tcWnd := FindWindow('TTOTAL_CMD', nil);
   if tcWnd <> 0 then
   begin
    ???
   end;
end;
[/b]
User avatar
Dalai
Power Member
Power Member
Posts: 9960
Joined: 2005-01-28, 22:17 UTC
Location: Meiningen (Südthüringen)

Post by *Dalai »

You can use WM_COPYDATA for this. There are several code examples in this forum, including some using Unicode (or rather UTF-8 ).

Which reminds me, that I wanted to post my version of the functions... Will do so when I have the time.

Regards
Dalai
#101164 Personal licence
Ryzen 5 2600, 16 GiB RAM, ASUS Prime X370-A, Win7 x64

Plugins: Services2, Startups, CertificateInfo, SignatureInfo, LineBreakInfo - Download-Mirror
User avatar
MVV
Power Member
Power Member
Posts: 8711
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

This is rather changing directory than focusing file, but TC allows focusing a file if you specify path to a file using change directory command.

As it was mentioned, WM_COPYDATA message is required for this. Some examples (you can find more yourself):
http://www.ghisler.ch/board/viewtopic.php?t=32658
http://www.ghisler.ch/board/viewtopic.php?t=36885
Post Reply