Mit den 3 von dir genannten Stichwörtern findet man die Beiträge schnell. Ich poste mal einen Sample-Code von mir:
private void loadACDSeeImage()
{
tryToLoadIcon(@"C:\Programme\Gemeinsame Dateien\ACD Systems\PlugIns2\IDE_ACDStd.apl", 2);
}
private void tryToLoadIcon(String pPath, int pIndex)
{
// HKEY_CLASSES_ROOT
// DEFAULTICON
uint iconNum = ExtractIconEx(
pPath, // filepath
-1, // start
null, // large icon out
null, // small icon out
0); // number of icons
if (iconNum > 0)
{
this.labelIconNum.Text = iconNum.ToString() + " Icon(s)";
if (pIndex < iconNum)
{
IntPtr[] largeIcons = new IntPtr[1];
IntPtr[] smallIcons = new IntPtr[1];
ExtractIconEx(
pPath, // filepath
pIndex, // start (index)
largeIcons, // large icon out
smallIcons, // small icon out
1); // number of icons
this.pictureBoxLarge.Image = Bitmap.FromHicon(largeIcons[0]);
this.pictureBoxSmall.Image = Bitmap.FromHicon(smallIcons[0]);
DestroyIcon(largeIcons[0]);
DestroyIcon(smallIcons[0]);
}
else
{
this.labelIconNum.Text = "wrong icon index";
}
}
else
{
this.labelIconNum.Text = "no icons found";
}
}