Interpret buttonbar as menu
Moderators: Hacker, petermad, Stefan2, white
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
I thought, -S %S was TCMenu syntax, not internally TC Syntax. TCMenu requires the -Letter flag to handle %Letter
TCMenu:
Command: %APPDATA%\GHISLER\GUI\TCMenu.exe
PARAMS: %%APPDATA%%\GHISLER\GUI\ToolBars\EDIT.BAR -S %S
Without TCMenu, a button looks like:
Command: chp.exe cmd.exe /c MultiFileOpen.cmd
params:%S
Basically, the [..] is pretty much breaking most of the things I would continue to use TCMenu.exe for.
Even my scripts have to acknowledge when they receive nothing it means [..] and treat it as if it is actually the current active directory.
If TC would just send the active current directory when the cursor is on [..] I wouldn't even need to code an exception for it.
TCMenu:
Command: %APPDATA%\GHISLER\GUI\TCMenu.exe
PARAMS: %%APPDATA%%\GHISLER\GUI\ToolBars\EDIT.BAR -S %S
Without TCMenu, a button looks like:
Command: chp.exe cmd.exe /c MultiFileOpen.cmd
params:%S
Basically, the [..] is pretty much breaking most of the things I would continue to use TCMenu.exe for.
Even my scripts have to acknowledge when they receive nothing it means [..] and treat it as if it is actually the current active directory.
If TC would just send the active current directory when the cursor is on [..] I wouldn't even need to code an exception for it.
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
- Samuel
- Power Member
- Posts: 1930
- Joined: 2003-08-29, 15:44 UTC
- Location: Germany, Brandenburg an der Havel
- Contact:
Probably not clear. Its the syntax of TCMenu, but TC sends the command.
When the two files are selected TC executes the command:
If ".." is selected TC executes the command: (with no parameters)
Instead of (What you probably think):
Edit: Seems like you already understood the problem before.
When the two files are selected TC executes the command:
Code: Select all
%APPDATA%\GHISLER\GUI\TCMenu.exe %APPDATA%\GHISLER\GUI\ToolBars\EDIT.BAR -S C:\File1.txt C:\File2.txt
Code: Select all
%APPDATA%\GHISLER\GUI\TCMenu.exe
Code: Select all
%APPDATA%\GHISLER\GUI\TCMenu.exe %APPDATA%\GHISLER\GUI\ToolBars\EDIT.BAR -S
2Balderstrom
Sorry, but I really cannot do anything.
TCMenu need to substitute parameters and if some of them are missing - I cannot execute the command. You speak about very simple case only - when parameters field contains single parameter (%S). But what I have to do if there will be more complex parameters combination? (i.e. "abc=%P def=<%S> ghi=%T") What should be passed for execution if some parameters are present and some parameters are missing?
You can avoid TCMenu substitution if you define em_ command and put all parameters inside em_ command definition.
Sorry, but I really cannot do anything.

TCMenu need to substitute parameters and if some of them are missing - I cannot execute the command. You speak about very simple case only - when parameters field contains single parameter (%S). But what I have to do if there will be more complex parameters combination? (i.e. "abc=%P def=<%S> ghi=%T") What should be passed for execution if some parameters are present and some parameters are missing?
You can avoid TCMenu substitution if you define em_ command and put all parameters inside em_ command definition.
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
@VadiMGP,
Thank you... It took a handful of trials to grok what you meant exactly, but I got it to work
To make TCMenu work when the cursor is on [..] and your Button has a parameter, that TCMenu is expecting, ie %S ::
Button on Main ButtonBar
Thank you... It took a handful of trials to grok what you meant exactly, but I got it to work

To make TCMenu work when the cursor is on [..] and your Button has a parameter, that TCMenu is expecting, ie %S ::
Button on Main ButtonBar
Contents of EDIT.BARCommand: %APPDATA%\GHISLER\GUI\TCMenu.exe
Parameters: %%APPDATA%%\GHISLER\GUI\ToolBars\EDIT.BAR
Contents of usercmd.ini[Buttonbar]
Buttoncount=2
button1=%APPDATA%\GHISLER\GUI\icons\Editors.icl,6
cmd1=em_openNotePad2
param1=
Or when not doing something as seemingly obscure as the MultiFileOpen.cmd and using chp (CreateHiddenProcess), just place your executable path there, ie:[em_openNotePad2]
button=
cmd=chp.exe cmd /c MultiFileOpen.cmd "%PROGRAMFILES%\¤EDITors\NotePad2K\notepad2.exe"
param=%S
Again, many thanks VadiMGP.cmd=%PROGRAMFILES%\SomeProgram\SomeProgram.exe
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
I had a heck of a time getting %P and %T passed thru, quoting doesn't seem to be working right when there were 2 separate paths being sent.
I tried numerous things, the final that worked was including an asterisk and ONE quote; and passing the result to cmd.exe to process/strip out the asterisk (*).
Which sends:
START "" "C:\Program Files\TotalCMD\TotalCMD.exe" /S=S: /L="__LEFT-PATH__" /R="__RIGHT-PATH__"
NOTE: Some of the many things attempted:
Parameters: ... compareDirs.bar -X %X -P %P -T %T
Parameters: ... compareDirs.bar -D %X -P %P -T %T
Parameters: ... compareDirs.bar -D %X%P %T
And many different quoting placements, i.e. -D "%X%P %T, or "%P" "%T"
No matter what was tried I couldn't get both paths through unscathed.
I tried numerous things, the final that worked was including an asterisk and ONE quote; and passing the result to cmd.exe to process/strip out the asterisk (*).
Item#1 in compareDirs.barCommand: %TCDATA%\GUI\TCMenu.exe
Parameters: %%TCDATA%%\GUI\ToolBars\†\compareDirs.bar -D %X "%P*%T
cmd1=%wuBIN%\exCMD\TCMenu_SyncTool.cmd
param1=%D
iconic1=1
button1=%TCmd%,32
menu1=Sync Dirs (L-R)
Code: Select all
::
:: TCMenu_SyncTool.cmd
::
FOR /F "usebackq tokens=1-2 delims=*" %%F IN ('%*') DO (
START "" "%TCMD%" /S=S: /L="%%~F" /R="%%~G
)
START "" "C:\Program Files\TotalCMD\TotalCMD.exe" /S=S: /L="__LEFT-PATH__" /R="__RIGHT-PATH__"
NOTE: Some of the many things attempted:
Parameters: ... compareDirs.bar -X %X -P %P -T %T
Parameters: ... compareDirs.bar -D %X -P %P -T %T
Parameters: ... compareDirs.bar -D %X%P %T
And many different quoting placements, i.e. -D "%X%P %T, or "%P" "%T"
No matter what was tried I couldn't get both paths through unscathed.
2Balderstrom
Please, read again 1st post of this topic.
TCMenu fulfilled his destiny. RIP.
I think it is better to use built-in TC drop-down menu feature.
Christian, may be it is time to remove TCMenu from your tools page as obsolete tool?
http://www.ghisler.com/tools.htm
Please, read again 1st post of this topic.

TCMenu fulfilled his destiny. RIP.
I think it is better to use built-in TC drop-down menu feature.
Christian, may be it is time to remove TCMenu from your tools page as obsolete tool?
http://www.ghisler.com/tools.htm
tcmenu 1.9
Hello,
I hope I found the right thread to ask,
I am using TC 8 B 18 with tcmenu 1.9, I have a problem, If I need to use TCMENU under an archive, it gives me "This function cannot be use with packed files"
How can I make the TCMENU to work even if is in an archive file...
THANKS!
I hope I found the right thread to ask,
I am using TC 8 B 18 with tcmenu 1.9, I have a problem, If I need to use TCMENU under an archive, it gives me "This function cannot be use with packed files"
How can I make the TCMENU to work even if is in an archive file...
THANKS!
Thank you MVV, the %Z param did the trick
[em_set_tc1]
Cmd=%COMMANDER_PATH%\Plugins\Media\TCmenu\TCmenu.exe
Param="%%COMMANDER_PATH%%\skins\DEFAULT01.bar" -$ %Z
Another question: How about the position of the tcmenu object? How do you set it to start around the cursor mouse?
PS: my bar menu go to the middle of the screen, not the cursor position....
[em_set_tc1]
Cmd=%COMMANDER_PATH%\Plugins\Media\TCmenu\TCmenu.exe
Param="%%COMMANDER_PATH%%\skins\DEFAULT01.bar" -$ %Z
Another question: How about the position of the tcmenu object? How do you set it to start around the cursor mouse?
PS: my bar menu go to the middle of the screen, not the cursor position....
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
- Balderstrom
- Power Member
- Posts: 2148
- Joined: 2005-10-11, 10:10 UTC
I think it's probably because the ControlName of the buttonBar has changed in TC8-64 --- would likely be an easy fix.
Maybe MVV could mention it on the Russian TC boards, that's where VadiMGP hangs out...
I hate google-translating my requests for there as I've no idea how accurate it will be... I know when I've translated the thread there on TwinKey the machine language translators have some serious issues with Russian jokes/metaphors, nuances and various syntax - to the point where some posts made nearly no sense at all.
Maybe MVV could mention it on the Russian TC boards, that's where VadiMGP hangs out...
I hate google-translating my requests for there as I've no idea how accurate it will be... I know when I've translated the thread there on TwinKey the machine language translators have some serious issues with Russian jokes/metaphors, nuances and various syntax - to the point where some posts made nearly no sense at all.
Balderstrom,
Well, usually machine translators convert EN to RU much better than RU to EN (EN requires specific word order and many other nuances while RU allows more flexibility because of variable word endings etc).
BTW I can't understand how TCMenu detects menu position. It works in same strange way for TC 7.04a, TC 8b19, TC 7.56a. Sometimes it is shown just under mouse cursor, sometimes only X position of cursor is used (menu is shown at the bottom of the screen)...
However it seems that problem has been fixed in last beta version (may be found here).
Well, usually machine translators convert EN to RU much better than RU to EN (EN requires specific word order and many other nuances while RU allows more flexibility because of variable word endings etc).
BTW I can't understand how TCMenu detects menu position. It works in same strange way for TC 7.04a, TC 8b19, TC 7.56a. Sometimes it is shown just under mouse cursor, sometimes only X position of cursor is used (menu is shown at the bottom of the screen)...
However it seems that problem has been fixed in last beta version (may be found here).