07-25-2019 03:32 PM
I am creating a program that is going to be able to open multiple file types and I would like to have each file type to have its own icon. I found how to configure it in the registry, but it depends on the executable having multiple icon resources built into it. Is there a way to do that in LV?
Mike...
07-25-2019 06:26 PM
You should be able to use a few .ico files for your files.
07-25-2019 06:56 PM
Yes, but the data from them needs to be incorporated into the executable somehow.
Mike...
07-25-2019 07:07 PM
Are you sure?
Is your OS Win7, or 10?
07-25-2019 08:24 PM
You might try something like Resource Hacker, run at post-build to add your custom ICO files. The command below will add an additional icon file to the exe:
ResourceHacker.exe -open "YourApp.exe" -save "ModifiedApp.exe" -action add -res "CustomIcon.ico" -mask ICONGROUP,2,
The number after ICONGROUP should be incremented for each icon added. The icon added by LabVIEW is 1.
You can also script the above to add multiple icons at once (untested):
[FILENAMES] Exe= YourApp.exe SaveAs= ModifiedApp.exe Log= Log.log [COMMANDS] -add CustomIcon1.ico, ICONGROUP,2,
-add CustomIcon2.ico, ICONGROUP,3,
-add CustomIcon3.ico, ICONGROUP,4,
07-25-2019 08:28 PM
I remember 20+ years ago adding an .ico to a VB built executable. I don't remember how I did it.
I googled and found this. https://command-tab.com/2008/07/21/how-to-combine-ico-files-into-a-windows-exe/
I wasn't messing with multiple icons, nor am I sure this is exactly what I did. But it seems similar in principle.
07-31-2019 01:50 PM
Thanks for pointing me towards ResourceHacker. I have managed to get the icon files included into the executable. The problem now is that that all the file types associated with the executable have the same icon. Using a utility I found on line, I can change the icon that is associated with them, but they all change at once. Is there some sort of resource or setting that tells Windows to let the different file types to have different icons?
Mike...
07-31-2019 03:09 PM
I don't think the executable would be what defines what file extensions are connected to what icon.
I think it would be some sort of Windows registry setting that defines what icons are associated with particular file extensions. Think of how Excel has different file types with different extensions, but click on them and they all still go to Excel.exe.
I don't have any details on this, but thinking this might point you in the correct direction.
08-09-2019 05:05 AM
Hi Mike
I've been working on a similar issue. I believe the icons in the executable are purely related to the executable itself. You can see them in Resource Hacker or edit them as layers in GIMP. As a rule there seem to be 12 layers; 16 colour, 256 colour and 24 bit at 16,32,48 and 256 pixels which I believe are used for the different instances of the icon in Windows.
This article change-a-file-types-icon-in-windows details a free utility that will allow a particular icon to be associated with each file type. Hopefully that helps.
NeilR
08-09-2019 05:41 AM
LV comes with an icon editor that can add as many layers/sizes as you'd like. It's called IconEdit and is located somewhere under the NI folder. It's the one that starts if you in your Build-project untick "default icon" and click Icon Editor.
/Y