Extended cmd, no icon in main menu

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
jonathanpoulin
Junior Member
Junior Member
Posts: 28
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Extended cmd, no icon in main menu

Post by *jonathanpoulin »

Hi,

If I add an extended (or user) command with a defined icon in %APPDATA%\GHISLER\usercmd.ini like that:

Code: Select all

[em_FooBar]
button=foobar.exe
cmd=foobar.exe
menu=Foo bar
and then want to add it to my main menu in c:\Program Files\totalcmd\LANGUAGE\WCMD_ENG.MNU with the following:

Code: Select all

...
POPUP "&Commands"
    ...
    MENUITEM "Foo bar", em_FooBar
END_POPUP
...
The icon is not displayed in the main menu (compared to when I add it to a button bar).

Am I missing something?

P.S. "Foo bar" is a fictive example as you understood.
Thanks,
Jonathan Poulin
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Extended cmd, no icon in main menu

Post by *beb »

2jonathanpoulin
If I recall correctly, you have to fulfill the following conditions to see custom icons for custom commands in the TC menus:
- use 'wciconex.inc' file to declare your custom commands and get them enumerated there in a special order.
- use 'wciconex.dll' file to store your custom icons.
Then wciconex.inc might look something like this (to begin with):

Code: Select all

// * user commands mappings
10000=128   // em_FooBar1
10001=233   // em_FooBar2
where:
10000 is the starting number for your first user command (em_FooBar1) that is used in TC menu
10001 is the second number for your second user command (em_FooBar2) that is used in TC menu
...
10098 ... em_FooBar99 ...

The numbering there should follow the order as your customs commands go in the TC menus (not the order as they met in the usercmd.ini), i.e. the first custom command met in the TC menu should be listed as 10000, the second one as 10001, ... the 99 one as 10098, etc.
Once you decide to reorder your custom commands in the menu(s), you will need to reorder/renumber them in the wciconex.inc respectively.

10000=233 -ish syntax principle (10000-sh number, equal sign, other number) is a mandatory, everything other in the example there (behind //) are the comments, where:
10000=128 means em_FooBar1 will use 128th icon from wciconex.dll
10001=233 means em_FooBar2 will use 233d icon from wciconex.dll

It is expected that you create, and maintain your wciconex.dll icon library on your own.

A common recommendation is to take vanilla WCMICON*.DLL, rename it as wciconex.dll, and then add your custom icons there one by one as needed.

Sounds awful, but that's how it works as far as I know.

Still, once you develop your consistent approach, it will be pretty easy to maintain.

PS I would be glad if something has been changed in that regard and someone else would share some innovative hints and know-hows here.
Last edited by beb on 2024-01-26, 22:38 UTC, edited 1 time in total.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Extended cmd, no icon in main menu

Post by *petermad »

2jonathanpoulin
You cannot have icons shown in the menu from the button field in the em_command

The only way to add icons to the menu is like beb describes, and it is only icons from your current icon library that can be used - for eample from from wcmicons.dll or wcmicon2.dll

It is very cumbersome to maintain, because each time your insert a new em_command in the menu, you have to update the whole list of indexes in wcmicons.inc from the inserted point an onward.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
beb
Senior Member
Senior Member
Posts: 435
Joined: 2009-09-20, 08:03 UTC
Location: Odesa, Ukraine

Re: Extended cmd, no icon in main menu

Post by *beb »

2jonathanpoulin
If you have a reasonable number of custom icons you'd want to see in the TC menu [for the custom user commands] and could somehow share them, I can make for you the first custom icon library of yours. As soon as you get the basic principles, then the deal to maintain it further would not seem that overcomplicated.
#278521 User License
Total Commander [always the latest version, including betas] x86/x64 on Win10 x64/Android 10
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Extended cmd, no icon in main menu

Post by *petermad »

2jonathanpoulin
For inspiration you can also download my Extended Menus. Once installed you can go to "Help" -> "Install Addons for Total Commander" - that will install a set of icon library and icon index (for example wcmicon_win10amd64.dll and wcmicon_win10amd64.inc) which adds icons for around 95 of of the em_commands in the Extended menu.

Don't be afraid to install the Menu - as soon as you choose your usual language file, everything is back to how it was before.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
jonathanpoulin
Junior Member
Junior Member
Posts: 28
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Re: Extended cmd, no icon in main menu

Post by *jonathanpoulin »

2beb

Thanks. It works BUT I lose all other menu icons. And, I needed to add the following line to my wciconex.inc.

Code: Select all

[mappings];
...
Also, it only works if I set my default library to wcmicons.dll. When set to wcmicon2.dll, I need to add the following line to the file WCMICONS.INC. Is that correct to do so?

Code: Select all

10000=28   // or any index
I would like to know as well what is the purpose of the dropdown menu in the "Icon library" dialog. I see one item in it, which is "wcmicon2.dll: TCNewLib1".
Thanks,
Jonathan Poulin
User avatar
petermad
Power Member
Power Member
Posts: 14809
Joined: 2003-02-05, 20:24 UTC
Location: Denmark
Contact:

Re: Extended cmd, no icon in main menu

Post by *petermad »

Thanks. It works BUT I lose all other menu icons. And, I needed to add the following line to my wciconex.inc.
[mappings];
Yes of course - just like it is in the default WCMICONS.INC file

Also, it only works if I set my default library to wcmicons.dll. When set to wcmicon2.dll, I need to add the following line to the file WCMICONS.INC. Is that correct to do so?
if you use wcmicon2.dll it will use wcmicon2.inc if it exist otherwise it will use WCMICONS.INC.
if you use wciconex.dll it will use wciconex.inc if it exist otherwise it will use WCMICONS.INC.

if wciconex.dll exists it wil automaticall be used when you choose wcmicons.dll

So if you want an .inc file that works for all .dll's you should use WCMICONS.INC and delete the other .inc files.

You often have to restart TC in order to see changes - or try run the command cm_ReloadBarIcons.
License #524 (1994)
Danish Total Commander Translator
TC 11.03 32+64bit on Win XP 32bit & Win 7, 8.1 & 10 (22H2) 64bit, 'Everything' 1.5.0.1371a
TC 3.50 on Android 6 & 13
Try: TC Extended Menus | TC Languagebar | TC Dark Help | PHSM-Calendar
User avatar
jonathanpoulin
Junior Member
Junior Member
Posts: 28
Joined: 2020-12-19, 12:09 UTC
Location: Saint-Marc-des-Carrières, QC Canada
Contact:

Re: Extended cmd, no icon in main menu

Post by *jonathanpoulin »

2petermad
Ok, great explanation to complement beb's one! Now, all is clear about that.
Thanks,
Jonathan Poulin
Post Reply