How to tell if Total Commnader is running?

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

Moderators: white, Hacker, petermad, Stefan2

Post Reply
graham_k
Junior Member
Junior Member
Posts: 18
Joined: 2005-06-05, 07:45 UTC

How to tell if Total Commnader is running?

Post by *graham_k »

Is there an official, approved, way to tell if Total Commnader is running?
User avatar
Vochomurka
Power Member
Power Member
Posts: 814
Joined: 2005-09-14, 22:19 UTC
Location: Russia
Contact:

Post by *Vochomurka »

If window with class TTOTAL_CMD exists. I don't know whether this is "official" way, but it is really approved.
Single user license #329241
PowerPro scripts for Total Commander
User avatar
Bluestar
Senior Member
Senior Member
Posts: 377
Joined: 2007-06-10, 15:26 UTC
Location: Hungary
Contact:

Post by *Bluestar »

In case you are writing an addon that needs to co-operate / rely on a running TC, you can also try to expand the "%COMMANDER_INI%" environment variable, since Total Commander versions above 7.00 will instantly return your application the exact configuration file path of the current TC instance, in case the app has been started by Total Commander.
» Developer of Total Updater & extDir utility.
User avatar
ts4242
Power Member
Power Member
Posts: 2081
Joined: 2004-02-02, 20:08 UTC
Contact:

Post by *ts4242 »

2graham_k

Use FindWindow to find TC window class name TTOTAL_CMD
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48077
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

%COMMANDER_INI% is only available when a program was loaded from within Total Commander, not from Explorer. Therefore better use the method suggested by ts4242.
Author of Total Commander
https://www.ghisler.com
User avatar
Bluestar
Senior Member
Senior Member
Posts: 377
Joined: 2007-06-10, 15:26 UTC
Location: Hungary
Contact:

Post by *Bluestar »

Yes, thats true - thats why I noticed "in case the app has been started by Total Commander" in my previous post - searching for TTOTAL_CMD class is a more universal way for sure.

For any other special cases, expanding the envvar can be a better solution though (e.g. when an addon _shouldn't_ work without a running Total Commander & it is needed to be run directly from TC).
» Developer of Total Updater & extDir utility.
Post Reply