How can I create a directory in C
and assign an icon to the folder all with in my program?
The point of this is all doing this in one program without any other dependencies. Is this possible?
How can I create a directory in C
and assign an icon to the folder all with in my program?
The point of this is all doing this in one program without any other dependencies. Is this possible?
CreateDirectory itself does not support creating an association between a directory and an icon. A directory can have an icon associated with it by instructing the shell to do so.
One way of doing this would be to specify the path to the icon in a desktop.ini file within the target directory.
I'm not sure if this still works because the last time I did it was in Windows 9x but I have seen a few desktop.ini files in Vista so I assume it is still supported to some extent
[Shell]
Icon=<path to icon>
NB: This may still work only because the support is provided for backwards-compatibility with earkier versions of Explorer. It's possible there is another less legacy way of doing this now that I am not aware of