Extract icon for a given extension

Posted by Am on Stack Overflow See other posts from Stack Overflow or by Am
Published on 2010-04-23T19:03:13Z Indexed on 2010/04/23 19:23 UTC
Read the original article Hit count: 135

Filed under:

Hi,

I know i can extract a file's icon using

using (System.Drawing.Icon sysicon = System.Drawing.Icon.ExtractAssociatedIcon(filePath))
{
    icon = System.Windows.Interop.Imaging.CreateBitmapSourceFromHIcon(
        sysicon.Handle,
        System.Windows.Int32Rect.Empty,
        System.Windows.Media.Imaging.BitmapSizeOptions.FromEmptyOptions());
}

But how can I extract the icon without a given file?

© Stack Overflow or respective owner

Related posts about c#