tags:

views:

1070

answers:

1

Possible Duplicate:
Get File Icon used by Shell

In my program i am reading a directory of files and displaying them as a ToolStripMenuItem

Normally i would use:

item.Image = Image.FromFile("icon.ico");

But how would i get the default icon that a given exe uses:

item.Image = Image.FromEXE("program.exe");

Is there a simple way to do it like that?

+1  A: 

See my previous question:
http://stackoverflow.com/questions/462270/get-file-icon-used-by-shell

In summary, it's really simple. Just call Icon.ExtractAssociatedIcon().

Joel Coehoorn