LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Icon sizes for Windows 7

Solved!
Go to solution

My application is running in Windows 7 Ultimate 64-bit and I'm using LabWindows/CVI 10.0.1. I created an icon file in the included icon editor. I kept the default 32x32 and 16x16 sizes and added 48x48 and 256x256 versions, all with 32-bit color. I set the Target Settings to use this new icon.

 

When I look at the folder containing my application's executable in Windows Explorer and go through the various methods of viewing the folder, not all of the sizes show my icon. The 16x16 image is used for the List and Details views, and as I increase the icon size the 32x32 and 48x48 versions seem to kick in. Then when the icon size gets to medium, I see the default LabWindows/CVI icon (the one that looks like a window with the "cvi" symbol in it). As I make the icons even larger, eventually the 256x256 version of my custom icon takes over.

 

MSDN seems to say that those three sizes are all the sizes required for Windows 7. How can I override the default "cvi" application icon for all sizes? Is it necessary to use a different icon editor to create some different size of icon image?

 

Thanks,

Brian

 

0 Kudos
Message 1 of 4
(4,040 Views)

Hello Brian,

     This is a unique question I have not seen the likes of before.  That being said I have started looking into this problem.  I tried what was said in the following link and I was able to link the icons.
http://www.winhelponline.com/blog/change-file-type-icon-windows-7-and-vista/

I also checked Wikipedia and it looks like 48x48 and 256x256 are the only necessary additional sizes for icons, the rest of the work is done in scaling options.

Let me know if that works.

Daniel

0 Kudos
Message 2 of 4
(4,021 Views)
Solution
Accepted by topic author Brian Richter

What is probably happening is that your icon cache is corrupt. Searching online, I found many different ways to resolve this issue and none of them "official" from Microsoft, so I am hesitant to recommend any one way to rebuild your icon cache. However, all I did to resolve this was delete C:\Users\<user>\AppData\Local\IconCache.db and restart my system. The IconCache.db was rebuilt and the correct icon shows for larger sizes rather than the default. It seems that the first icon you view at the medium/large size gets stuck in the IconCache. For instance, I changed my icon before viewing it at a larger size (never saw the CVI icon) and the icon I used was the one stuck for the medium/large size.I don't think it will be an issue on a target system because you will not be changing the icon one you distribute the application.

 

It is not clear to me if this is an issue with a Windows bug (I did see similar reports on various forums, but nothing official), with our icon editor, or with the way CVI attaches icons to executables. I have filed bug report 354481 to investigate this issue.

National Instruments
0 Kudos
Message 3 of 4
(4,014 Views)

Today upon restarting that computer, the icon for that same executable now looks correct at all sizes. The file hasn't been touched since I saw the problem, so something must have caused the icon cache to be cleared.

 

The executable was built repeatedly in the same location with the default icon before the new icon was added, so it is reasonable that the old icon was in the icon cache. Once the application is installed for real, the icon won't change so this shouldn't be an issue.

 

Thanks,

Brian

0 Kudos
Message 4 of 4
(4,004 Views)