cm_mand plugin

Here you can propose new features, make suggestions etc.

Moderators: petermad, Stefan2, Hacker

Hurdet
Power Member
Power Member
Posts: 789
Joined: 2003-05-10, 18:02 UTC

cm_mand plugin

Post by *Hurdet »

Possibility to create a coded plugin that add command cm_xxx other that in TOTALCMD.INC
gdpr deleted 6
Power Member
Power Member
Posts: 876
Joined: 2013-09-04, 14:07 UTC

Re: cm_mand plugin

Post by *gdpr deleted 6 »

EDIT: Ignore this post. I didn't realize this is in the Suggestions sub-forum.

̶Y̶o̶u̶ ̶a̶s̶k̶e̶d̶ ̶t̶h̶i̶s̶ ̶q̶u̶e̶s̶t̶i̶o̶n̶ ̶a̶l̶r̶e̶a̶d̶y̶.̶ ̶W̶h̶y̶ ̶o̶p̶e̶n̶ ̶a̶ ̶d̶u̶p̶l̶i̶c̶a̶t̶e̶ ̶t̶o̶p̶i̶c̶ ̶i̶n̶s̶t̶e̶a̶d̶ ̶o̶f̶ ̶b̶u̶m̶p̶i̶n̶g̶ ̶y̶o̶u̶r̶ ̶o̶r̶i̶g̶i̶n̶a̶l̶ ̶q̶u̶e̶s̶t̶i̶o̶n̶ ̶t̶o̶p̶i̶c̶?̶ ̶ :?
̶h̶t̶t̶p̶s̶:̶/̶/̶w̶w̶w̶.̶g̶h̶i̶s̶l̶e̶r̶.̶c̶h̶/̶b̶o̶a̶r̶d̶/̶v̶i̶e̶w̶t̶o̶p̶i̶c̶.̶p̶h̶p̶?̶f̶=̶6̶&̶t̶=̶7̶2̶7̶4̶2̶&̶p̶=̶3̶9̶2̶1̶5̶5̶


̶S̶h̶o̶r̶t̶ ̶a̶n̶s̶w̶e̶r̶:̶ ̶N̶o̶.̶ ̶O̶r̶ ̶d̶i̶d̶ ̶y̶o̶u̶ ̶s̶e̶e̶ ̶a̶n̶y̶ ̶A̶P̶I̶ ̶i̶n̶ ̶a̶n̶y̶ ̶o̶f̶ ̶t̶h̶e̶ ̶p̶l̶u̶g̶-̶i̶n̶ ̶t̶y̶p̶e̶s̶ ̶t̶h̶a̶t̶ ̶w̶o̶u̶l̶d̶ ̶a̶l̶l̶o̶w̶ ̶a̶ ̶p̶l̶u̶g̶-̶i̶n̶ ̶t̶o̶ ̶d̶e̶f̶i̶n̶e̶ ̶a̶n̶d̶ ̶r̶e̶g̶i̶s̶t̶e̶r̶ ̶t̶h̶e̶i̶r̶ ̶o̶w̶n̶ ̶c̶m̶_̶*̶ ̶c̶o̶m̶m̶a̶n̶d̶s̶ ̶w̶i̶t̶h̶ ̶T̶o̶t̶a̶l̶ ̶C̶o̶m̶m̶a̶n̶d̶e̶r̶?̶ :wink:
Last edited by gdpr deleted 6 on 2020-09-14, 16:43 UTC, edited 1 time in total.
Hurdet
Power Member
Power Member
Posts: 789
Joined: 2003-05-10, 18:02 UTC

Re: cm_mand plugin

Post by *Hurdet »

That was a question, this is a suggestion.
gdpr deleted 6
Power Member
Power Member
Posts: 876
Joined: 2013-09-04, 14:07 UTC

Re: cm_mand plugin

Post by *gdpr deleted 6 »

Hurdet wrote: 2020-09-14, 16:07 UTC That was a question, this is a suggestion.
My sincere apologies. Seems i got confused with the sub-forums here. My bad :(
Hurdet
Power Member
Power Member
Posts: 789
Joined: 2003-05-10, 18:02 UTC

Re: cm_mand plugin

Post by *Hurdet »

No problem :-)
User avatar
MVV
Power Member
Power Member
Posts: 8753
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: cm_mand plugin

Post by *MVV »

What is the reason? What you can't do now that you will be able to do with this feature?
Hurdet
Power Member
Power Member
Posts: 789
Joined: 2003-05-10, 18:02 UTC

Re: cm_mand plugin

Post by *Hurdet »

f.e. I could to execute SendMessage or simple COPY_DATA message directly from TC without addons.
User avatar
nsp
Power Member
Power Member
Posts: 2080
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: cm_mand plugin

Post by *nsp »

You can already create as much as you like command as user command and then call with copy_data...
Hurdet
Power Member
Power Member
Posts: 789
Joined: 2003-05-10, 18:02 UTC

Re: cm_mand plugin

Post by *Hurdet »

I obviously already know this, but a direct approach without creating processes would be preferable.
As I have already written:
directly from TC without addons.
User avatar
nsp
Power Member
Power Member
Posts: 2080
Joined: 2005-12-04, 08:39 UTC
Location: Lyon (FRANCE)
Contact:

Re: cm_mand plugin

Post by *nsp »

Normally button, menu Item, command, aliases should fulfill your needs if you just want call inside TC.
Unless i miss your scenario. (can you give a sample)
Hurdet
Power Member
Power Member
Posts: 789
Joined: 2003-05-10, 18:02 UTC

Re: cm_mand plugin

Post by *Hurdet »

Hurdet
Power Member
Power Member
Posts: 789
Joined: 2003-05-10, 18:02 UTC

Re: cm_mand plugin

Post by *Hurdet »

I would really like to see support in TCmd for creating custom commands through DLL-based plugins.

Being able to extend the command system via external DLLs would open up a lot of possibilities for advanced users and developers. For example, it could allow integration of custom logic, system-level operations, or specialized workflows directly into TCmd without modifying the core application.

A simple plugin interface—where a DLL can register new commands and handle their execution—would make TCmd far more flexible and extensible, especially for those of us working with low-level or system programming tasks.

Is this something that could be considered for future development?
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: cm_mand plugin

Post by *Fla$her »

2Hurdet
RegisterCommand appeared in Autorun 2.2.11 beta 2 years ago.
You can look for my examples on the forum.
Overquoting is evil! 👎
Hurdet
Power Member
Power Member
Posts: 789
Joined: 2003-05-10, 18:02 UTC

Re: cm_mand plugin

Post by *Hurdet »

I’m trying to call a custom DLL with a dynamic parameter like %P%N (selected file path + name) using Autorun.
RegisterCommand

Registers a free internal command bound to an Autorun function.

From a button, the bound function receives only a single 32-bit numeric ID, not a string.

The Autorun author states the button passes a number, the menu passes no parameters, and multiple variants require multiple command numbers (e.g. 60001, 60002, 60003).

Result: you cannot pass %P%N (or %P, %N, %T) via RegisterCommand.

DllCall

In Autorun.cfg, you can write:

text
DllCall "MyLib.dll", "MyFunction", "%P%N"

and Autorun substitutes %P%N before calling the DLL.

But this substitution only happens in Autorun.cfg at TC startup.

When triggered from a button via RegisterCommand, you don’t get dynamic placeholders.

Result: %P%N works in Autorun.cfg, but not from a button using RegisterCommand.

Conclusion

With Autorun:

RegisterCommand from a button → numeric ID only, no %P%N.

DllCall in Autorun.cfg at startup → supports %P%N, but not from a button.

If you need a button that calls a DLL with %P%N, you need:

A small EXE launcher that receives %P%N as a command-line argument, or

A custom plugin designed for explicit invocation, or

A TC internal command using ShellExec on an external tool.

Anyone knows a way to pass full placeholders like %P%N from a button using RegisterCommand or DllCall in Autorun?

Thanks!
Fla$her
Power Member
Power Member
Posts: 4033
Joined: 2020-01-18, 04:03 UTC

Re: cm_mand plugin

Post by *Fla$her »

From a button, the bound function receives only a single 32-bit numeric ID, not a string.
For named commands, you need to edit totalcmd.inc. It seems you didn't look for my examples.
In Autorun.cfg, you can write:

text
DllCall "MyLib.dll", "MyFunction", "%P%N"
Maybe it's better this way? —>

Code: Select all

LoadLibrary Plugins\Autorun_Runtime.dll
#——————————————————————————————————————

RegisterCommand 77777 MyFunc

Func MyFunc()
   DllCall('MyLib.dll', 'MyFunction', GetCurrentPath(3, 2))
EndFunc
Overquoting is evil! 👎
Post Reply