且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何获得与文件类型关联的图标?

更新时间:2023-02-08 19:14:01

$ C $的CProject 一>有一些课程,你可以下载。

CodeProject has some classes you can download.

首先得到FileAssociationInfo,并从获得ProgramAssociationInfo。该PAI对象可以给你的图标。

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;