2
jonathanpoulin
Is there a way to add a custom main menu item (under the Commands menu by example) with an icon for an em_ command, BUT without having to add that em_ on a button bar beforehand?
You don't have to add the em_command to a button - in fact that has no effect. And the icons in the Start menu and button bars has no influence on the number of the command you have to assign an icon to in the .inc file for use in the Menu.
What you do is count the em_commands in your .mnu file - the first one will be assigned command no. 10000 and so forth. You can
only assign icons from your current default icon library. If your default icon library is wcmicons.dll you assign the icons in the corresponding wcmicons.inc file, so if you for example want to use the 1st icon in wcmicons.dll (the green reloading arrows) for the first em_command in your .mnu file you assign 10000=0
If you use the same em_command more than one time in the .mnu file you must not assign it again - skip the duplicated em_command when you count.
it is unfortunately NOT possible to assign icons that are not in the default icon library to the menu, just by setting an external icon (from a .ico, .exe, .dll, or .icl file) for the em_command.
Icons set in the em_command are
only used in the button bars, and only if you select the em_command via clicking the button with the magnifying glass, when you create the button (via the Choose Command dialog).
So if you want custom icons in your menu
you have to add the icon to the icon library (for example wcmicons.dll).
If you want to make your own library file it is important that it has the correct Versioninfo embedded in the .dll file.
The minimum Versioninfo could look like:
Code: Select all
1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEOS 0x40000
FILETYPE 0x1
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "FileDescription", "My own Icons for TC"
VALUE "FileVersion", "1.0.0.0"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409 0x04E4
}
}
otherwise it will not turn up in the list of libraries that you get when you click the button "Set default icon library" in the Icons configuration (or when you right click the button bar).
You can use a program like ResourceHacker to add the Versioninfo.
If you choose to make your own icon library, the file name has to start with wcmicon for example wcmiconmyicons.dll - if you make a corresponding wcmiconmyicons.inc file then that file will be used for mapping the icons, otherwise your wcmicons.inc file will be used.