Total Commander API

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
Gregory
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-08, 10:04 UTC
Location: Kiev, Ukraine

Total Commander API

Post by *Gregory »

ghisler(Author) wrote:
The command cm_UnloadPlugins will unload all plugins. You can send TC the following command:

wm_InvokeMenuCommand=WM_USER+51

with WPARAM set to the command you want to pass to TC.
Many thanks for such information. I can now include internal commands of TC in scripts I write with PowerPro.
I wonder if there are other actions that can be done in TC in that way.[/b]
User avatar
Aezay
Senior Member
Senior Member
Posts: 269
Joined: 2003-02-12, 07:27 UTC
Location: Denmark
Contact:

Post by *Aezay »

I thought about making a program where u could write scripts for TC, but there doesn't seem to be any way to get a list of the files in the left and right listboxes.

What I did was to send TC the LB_GETTEXT message with an index within range of the number of items in that listbox. I set wParam to a buffer[512] i think, just to be sure i had enough, but for all items it only returned 4 bytes with the same value (can't remember what).

I just want to know if there is any way of getting all the filenames in the listboxes? If not, would u consider adding better support for 3rd party tools Christian?
Of all the planets I've been to, this one is my favorite.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48075
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

What I did was to send TC the LB_GETTEXT message with an index within range of the number of items in that listbox. I set wParam to a buffer[512] i think, just to be sure i had enough, but for all items it only returned 4 bytes with the same value (can't remember what).
Sorry, TC uses an owner-drawn listbox, you can't get the file names this way. Please don't try such things, instead use a button with the %L parameter.
Author of Total Commander
https://www.ghisler.com
Gregory
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-08, 10:04 UTC
Location: Kiev, Ukraine

Post by *Gregory »

Is there any way to obtain real file names from plugins like Temporary Drive or Temporary Panel?

When I run cm_CopyFullNamesToClip paths inside the plugin are copied but those paths are useless for external programs.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48075
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately not - there is no function to get these names. The above plugins are indeed very special, and the plugin interface isn't ideal for their implementation...
Author of Total Commander
https://www.ghisler.com
VadiMGP
Power Member
Power Member
Posts: 672
Joined: 2003-04-05, 12:11 UTC
Location: Israel

Total Commander API

Post by *VadiMGP »

Gregory wrote:wrote:
I wonder if there are other actions that can be done in TC in that way.[/b]
Cristian, if it possible to send in that way to TC commands contained string? Like "cd" command or "notepad %p%n"?
User avatar
pdavit
Power Member
Power Member
Posts: 1529
Joined: 2003-02-05, 21:41 UTC
Location: Kavala -> Greece -> Europe -> Earth -> Solar System -> Milky Way -> Space
Contact:

Post by *pdavit »

"My only reason for still using M$ Window$ as an OS is the existence of Total Commander!"
Christian Ghisler Rules!!!
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48075
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

VadiMGP wrote:Cristian, if it possible to send in that way to TC commands contained string? Like "cd" command or "notepad %p%n"?
No, you need to call totalcmd.exe with /O switch and some other command line parameters to do this. This actually uses WM_COPYDATA to pass the names to the already running Commander, because WM_COPYDATA is the only Windows message to pass string data between programs!
Author of Total Commander
https://www.ghisler.com
Gregory
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-08, 10:04 UTC
Location: Kiev, Ukraine

Post by *Gregory »

ghisler(Author) wrote:This actually uses WM_COPYDATA to pass the names to the already running Commander, because WM_COPYDATA is the only Windows message to pass string data between programs!
So what will happen exactly if I send WM_COPYDATA to Commander?
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48075
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Please don't do it directly, it may change in the future. It's used to change the current directories, but this can be achieved by calling TC with the /O option too.
Author of Total Commander
https://www.ghisler.com
Gregory
Junior Member
Junior Member
Posts: 89
Joined: 2003-02-08, 10:04 UTC
Location: Kiev, Ukraine

Post by *Gregory »

Direct call of WM_COPYDATA has one advantage. If I have several instances of Total Commander opened I can choose in which one directories should be changed (e.g. in active Commander).

So I have a wish for a new command line switch that changes directories in current Total Commander window.

Er... Even two wishes. Second wish is about another switch that changes directory in active panel.
Post Reply