cm_mand plugin
Moderators: petermad, Stefan2, Hacker
cm_mand plugin
Possibility to create a coded plugin that add command cm_xxx other that in TOTALCMD.INC
-
gdpr deleted 6
- Power Member

- Posts: 876
- Joined: 2013-09-04, 14:07 UTC
Re: cm_mand plugin
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̶?̶
̶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̶?̶
Last edited by gdpr deleted 6 on 2020-09-14, 16:43 UTC, edited 1 time in total.
Re: cm_mand plugin
That was a question, this is a suggestion.
-
gdpr deleted 6
- Power Member

- Posts: 876
- Joined: 2013-09-04, 14:07 UTC
Re: cm_mand plugin
My sincere apologies. Seems i got confused with the sub-forums here. My bad
Re: cm_mand plugin
What is the reason? What you can't do now that you will be able to do with this feature?
Re: cm_mand plugin
f.e. I could to execute SendMessage or simple COPY_DATA message directly from TC without addons.
Re: cm_mand plugin
You can already create as much as you like command as user command and then call with copy_data...
Re: cm_mand plugin
I obviously already know this, but a direct approach without creating processes would be preferable.
As I have already written:
As I have already written:
directly from TC without addons.
Re: cm_mand plugin
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)
Unless i miss your scenario. (can you give a sample)
Re: cm_mand plugin
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?
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?
Re: cm_mand plugin
2Hurdet
RegisterCommand appeared in Autorun 2.2.11 beta 2 years ago.
You can look for my examples on the forum.
RegisterCommand appeared in Autorun 2.2.11 beta 2 years ago.
You can look for my examples on the forum.
Overquoting is evil! 👎
Re: cm_mand plugin
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!
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!
Re: cm_mand plugin
For named commands, you need to edit totalcmd.inc. It seems you didn't look for my examples.From a button, the bound function receives only a single 32-bit numeric ID, not a string.
Maybe it's better this way? —>In Autorun.cfg, you can write:
text
DllCall "MyLib.dll", "MyFunction", "%P%N"
Code: Select all
LoadLibrary Plugins\Autorun_Runtime.dll
#——————————————————————————————————————
RegisterCommand 77777 MyFunc
Func MyFunc()
DllCall('MyLib.dll', 'MyFunction', GetCurrentPath(3, 2))
EndFuncOverquoting is evil! 👎