4

I want to get the associated file type icon in my WPF app. Currently I can get the 32x32 version using System.Drawing.Icon.ExtractAssociatedIcon(filePath). However, I want the biggest available icon. How can I achieve this?

For example I want to get the icon for HTML files like the one below (shown in my Explorer):

enter image description here

Alireza Noori
  • 14,961
  • 30
  • 95
  • 179
  • I am not in a position to test this, so will comment. Have you tried passing the icon to `new Icon(originalIcon, new Size(256, 256))`? This will attempt to resolve the 256x256 size within `originalIcon`. If it doesn't have that size, the closest smaller size will be resolved. – Kent Boogaart May 04 '13 at 20:53
  • @KentBoogaart Tried, didn't work. Thanks. – Alireza Noori May 05 '13 at 02:59
  • you're certain that the icon in question actually has a variant greater than 32x32? Have you tried extracting the icon from other places where you know that there's a large variant available? – Kent Boogaart May 05 '13 at 07:43
  • Yes. Take a look at the image attached above. – Alireza Noori May 05 '13 at 09:22

0 Answers0