If Icon.ExtractAssociatedIcon(filePath)
is the only way to get icons in .NET && if it doesn't work for Drives and Directories (does it?) then how do you go about getting the icons for them?
In other words, I'd like to
foreach (string driveName in Directory.GetLogicalDrives())
//if (System.IO.Directory.Exists(driveName))
{
using (System.Drawing.Icon systemIcon = System.Drawing.Icon.ExtractAssociatedIcon(driveName))
{ ... }
}
^ this obviously doesn't work (works only for files)
I'm not sure System.IO.Directory.Exists(file)
is the right way for detecting if drives exist as well...