Search code examples
winformsoracledevartdotconnect

What is an icon file (.ico) that I can rely on every Windows user having?


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";

Solution

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

    An example:

    Icon appIcon = System.Drawing.SystemIcons.Application;