Link to home
Start Free TrialLog in
Avatar of rossryan
rossryan

asked on

Folder icons

Anyone know a quick way to grab folder icons?
Avatar of TheAvenger
TheAvenger
Flag of Switzerland image

What do you mean "grab folder icons"?
Avatar of rossryan
rossryan

ASKER

Hmm. Load it into memory, modify it...

Example (for file icons):

//Image for the file.
            private void setImage(string fileName)
            {
                  
                  Bitmap b;
                  
                  FileIcon f = new FileIcon(
                        fileName,
                        FileIcon.SHGetFileInfoConstants.SHGFI_LARGEICON |
                        FileIcon.SHGetFileInfoConstants.SHGFI_ICON);
                        
                  b = f.ShellIcon.ToBitmap();

                  _image = b;
            }
Have you tried the same with a path to a folder instead to a file?
Hmm. The Class (not mine) I am using for Icon Extraction says this:

/// Enables extraction of icons for any file type from
      /// the Shell.

But I am willing to give it a try...
Crashed.
I cannot think of the icons as being stored in the path...perhaps the registry?
ASKER CERTIFIED SOLUTION
Avatar of AdrianJMartin
AdrianJMartin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Right. I'll give it a shot.