1

I am extracting the icon from .exes, but want to have a fallback generic icon if for some reason Icon.ExtractAssociatedIcon(sPathOfExe) fails.

Is there one I can resort to like so that would be safer than what I'm currently using:

private const string defaultIcon = @"C:\WINDOWS\ServicePackFiles\i386\msnms.ico";
4

3 回答 3

3

You can always fall back to one of the SystemIcons located in the System.Drawings class:

An example:

Icon appIcon = System.Drawing.SystemIcons.Application;
于 2012-04-09T16:00:03.970 回答
1

I think you can not get an ico file that will always be available. Probably you can find one that exists nowadays, on most versions, but you have no guarantee it will still be available in future versions.

Why not:

  1. ship a ico file with your software
  2. do a recursive serach for ico files inside the Windows folder?

HTH

于 2012-04-09T15:21:46.503 回答
1

If you can create and distribute your own application then what is stopping you to add your own icon to the application as a default icon ?

于 2012-04-10T01:14:26.720 回答