John Smith
John Smith

Reputation: 1421

assign an icon to a file in c#

I have an application that would create a file of some extension, let say .ext, and assign an icon to it. The problem is that, I can create many .ext files and all of them should have different icons.

For eg:

foo.ext --> icon as foo.png

bar.ext --> icon as bar.png

I can register my application to open the specific extension (.ext in this case) and do the required task, but I don't know how to show different icons to different files.

Is it possible to do so? I am using c#, but a native API in c/c++ would also do.

Thanks,

John

Upvotes: 2

Views: 935

Answers (1)

SLaks
SLaks

Reputation: 888187

You need to create an icon handler shell extension.

Upvotes: 3

Related Questions