CodeProject has some classes you can download.
First get the FileAssociationInfo
, and from that get the ProgramAssociationInfo
. The pai
object can give you the icon.
FileAssociationInfo fai = new FileAssociationInfo(".bob");
ProgramAssociationInfo pai = new ProgramAssociationInfo(fai.ProgID);
ProgramIcon icon = pai.DefaultIcon;