wm_copydata for cm_command with parameter not working
Moderators: Hacker, petermad, Stefan2, white
wm_copydata for cm_command with parameter not working
I want to convert many em_command which are just command with parameter I call from powerpro using wm_copydata mechanisn with 0x4D45.
I want to use CD, SELECTFILES, LOADSEARCH, LOADLIST, SAVESELECTION ... In the history i've seen:
19.06.16 Added: Use WM_COPYDATA to also send cm_commands with parameters to TC, with command used to send em_commands (32/64)
I''m not able to call such command with a filename/pattern as parameter, anyhow if i use an em command with %A as parameter, it is working.
It is also not working from tc command_line. Why not detecting all command with parameter listed by TC as TC command and still searching for a file to execute.
Do you have a working sample for CD |*\ CD *.* SELECTFILES *.bak OPENSEARCH ==Images do you have a flag in Total commander to log what is received and rejection reason if the command is not executed !
I want to use CD, SELECTFILES, LOADSEARCH, LOADLIST, SAVESELECTION ... In the history i've seen:
19.06.16 Added: Use WM_COPYDATA to also send cm_commands with parameters to TC, with command used to send em_commands (32/64)
I''m not able to call such command with a filename/pattern as parameter, anyhow if i use an em command with %A as parameter, it is working.
It is also not working from tc command_line. Why not detecting all command with parameter listed by TC as TC command and still searching for a file to execute.
Do you have a working sample for CD |*\ CD *.* SELECTFILES *.bak OPENSEARCH ==Images do you have a flag in Total commander to log what is received and rejection reason if the command is not executed !
Re: wm_copydata for cm_command with parameter not working
@ghisler(Author) can you explain why the command with parameter cannot be called correctly from TC command line or wm_copydata.
If i define alias (same name calling em_command with %A) i can do it but why do i need those 2 extra step.
I do support for some colleague each time i need to go with user command step even to call standard commands. I also provide powerpro or other kind of script but it never work out of the box. I need to check for em_command or explain that calling TC from script do not works for all command even from TC internal command line..
We also have in totalcmd.inc (command browser as UI) a section called command with parameter but the one listed do not work on command line nor on wm_copydata except CD. Some "normal" cm_ command have hidden parameter and works on command line and wm_copydata but the only way to know it is to study history and the forum. This makes the learning curve painful and somehow frustrating.
If i define alias (same name calling em_command with %A) i can do it but why do i need those 2 extra step.
I do support for some colleague each time i need to go with user command step even to call standard commands. I also provide powerpro or other kind of script but it never work out of the box. I need to check for em_command or explain that calling TC from script do not works for all command even from TC internal command line..
We also have in totalcmd.inc (command browser as UI) a section called command with parameter but the one listed do not work on command line nor on wm_copydata except CD. Some "normal" cm_ command have hidden parameter and works on command line and wm_copydata but the only way to know it is to study history and the forum. This makes the learning curve painful and somehow frustrating.
Re: wm_copydata for cm_command with parameter not working
Specifying cm_ commands in the header is unwarranted.
Parameterized commands without CM_ work from the command line. There were enough tests and fixes on the forum.
For WM_COPYDATA, this topic has existed for a long time and there is no point in placing it in the bugs section.
Parameterized commands without CM_ work from the command line. There were enough tests and fixes on the forum.
For WM_COPYDATA, this topic has existed for a long time and there is no point in placing it in the bugs section.
Last edited by Fla$her on 2025-04-12, 12:50 UTC, edited 4 times in total.
Overquoting is evil! 👎
Re: wm_copydata for cm_command with parameter not working
Did you use capital letters for these commands?nsp wrote: 2025-04-12, 07:04 UTC We also have in totalcmd.inc (command browser as UI) a section called command with parameter but the one listed do not work on command line nor on wm_copydata except CD.
Or press F1 when you have the command browser on your screen.nsp wrote: 2025-04-12, 07:04 UTC Some "normal" cm_ command have hidden parameter and works on command line and wm_copydata but the only way to know it is to study history and the forum. This makes the learning curve painful and somehow frustrating.
Or look at this wiki page: https://www.ghisler.ch/wiki/index.php?title=List_of_internal_commands
Re: wm_copydata for cm_command with parameter not working
Other than the CD/cd discrepancies, I don't remember any string case problems in the command line.
Overquoting is evil! 👎
Re: wm_copydata for cm_command with parameter not working
Help page "Command line":Fla$her wrote: 2025-04-12, 13:22 UTC Other than the CD/cd discrepancies, I don't remember any string case problems in the command line.
The command line also handles internal commands starting with cm_ and em_, and commands with parameters like OPENTABS. The latter must be written in capital letters.
Re: wm_copydata for cm_command with parameter not working
I understood why it worked. In the drop-down list there were duplicate commands in uppercase, and TC selects them if you write in lowercase. Strange, of course.
Overquoting is evil! 👎
Re: wm_copydata for cm_command with parameter not working
On the command line, if i use SaveTabs, LoadList, SelectFiles .. (it is more natural for me to write this way) instead of the full name in UPPERCASE or lowercase command is not found. It works anyhow for some of them like "LoadSearch" but not for all.
On wm_copydata message, all commands not starting with cm_ or em_ does not work at all.
If you have powerpro and total commander 64bit, just try this in a script or a note:
You can do the same in autohotkey or C or pascal or whatever. 0x4D45 is the dword signal for em_cmd.
This is the meaning of this bug report.
On wm_copydata message, all commands not starting with cm_ or em_ does not work at all.
If you have powerpro and total commander 64bit, just try this in a script or a note:
Code: Select all
win.handle("=TOTALCMD64").sendcopydata(0x4D45,"cm_verticalpanels 0") --> the call works (do it twice)
win.handle("=TOTALCMD64").sendcopydata(0x4D45,"LOADSEARCH Archives") --> call do not works
win.handle("=TOTALCMD64").sendcopydata(0x4D45,"SELECTFILES *.bak *.old *.tmp") --> call do not works
win.handle("=TOTALCMD64").sendcopydata(0x4D45,"em_selectfiles *.bak *.old *.tmp") --> works if you have defined em_selectfiles as a user cmd with SELECTFILES as command and %A as parameter
This is the meaning of this bug report.
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: wm_copydata for cm_command with parameter not working
Currently only cm_ and em_ commands are supported via WM_COPYDATA. This isn't a bug, it's a limitation. I'm therefore moving this thread to the suggestions forum.
Moderator message from: ghisler(Author) » 2025-04-13, 08:51 UTC
Moved to suggestions
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: wm_copydata for cm_command with parameter not working
As I immediately made it clear, this is not a bug, but a limitation. It's enough just to join the support in an existing MVV topic.
Overquoting is evil! 👎
Re: wm_copydata for cm_command with parameter not working
[/quote]
It is just a parsing issue for the first term of the passed data and almost same thing to do that what is dome from the command_line.
@ghisler(Author) When do you plan to fix it ?
Even if you call it a limitation, it is for me a coherency discrepancy.It has been asked by MVV 6 years ago without any response.ghisler(Author) wrote: 2025-04-13, 08:52 UTC Currently only cm_ and em_ commands are supported via WM_COPYDATA. This isn't a bug, it's a limitation. I'm therefore moving this thread to the suggestions forum.
It is just a parsing issue for the first term of the passed data and almost same thing to do that what is dome from the command_line.
@ghisler(Author) When do you plan to fix it ?
Re: wm_copydata for cm_command with parameter not working
2025 year, we still can't send powerful commands X_X
- ghisler(Author)
- Site Admin
- Posts: 50383
- Joined: 2003-02-04, 09:46 UTC
- Location: Switzerland
- Contact:
Re: wm_copydata for cm_command with parameter not working
Why not just put it in an em_command and then call that?
Author of Total Commander
https://www.ghisler.com
https://www.ghisler.com
Re: wm_copydata for cm_command with parameter not working
I'm sharing my scripts and each time i need to also explain and share usercmd.ini stuff amd em_CMDXXX for each and every command needing parameter.ghisler(Author) wrote: 2025-04-22, 10:13 UTCWhy not just put it in an em_command and then call that?
It would be great to have it work out the box without asking to edit usercmd.ini. It is just mapping one command with same name and same parameter %A all the time. All the other command works even the cm_cmd with parameter but not some of the most usefull to manipulate TABS, SELECTION, LIST, Some of them have modifier and need many variant like SELECTFILES which is a bit too much.
Re: wm_copydata for cm_command with parameter not working
As MVV wrote,ghisler(Author) wrote: 2025-04-22, 10:13 UTC Why not just put it in an em_command and then call that?
The reasons, in my opinion, are obvious:MVV wrote: 2019-11-05, 07:53 UTCIt isn't portable and useful to create a wrapper command per every command with parameters.
- Overwriting ini in the code itself slows down the speed of its operation, and the entry itself with checking for its presence (for example, in a button with TCFS2) becomes much longer. Moreover, usercmd.ini may already have similar commands, which is fraught with their overwriting or duplication of functionality, which is unsafe when publishing code.
- If one overwrite ini manually, then, as has already been made clear, this leads to the need to constantly warn users about additional actions that are not always interpreted correctly by beginners, as a result of which errors are possible.
Overquoting is evil! 👎