...das HauptIcon einer Exe-Datei auslesen?
|
Autor:
Thomas Stutz |
[ Tip ausdrucken ] | | |
procedure TForm1.Button1Click(Sender: TObject);
var
Icon: TIcon;
FileInfo: SHFILEINFO;
begin
Icon := TIcon.Create;
try
// Get the Icon
SHGetFileInfo(PChar('Filename.exe'), 0, FileInfo, SizeOf(FileInfo), SHGFI_ICON);
icon.Handle := FileInfo.hIcon;
DestroyIcon(FileInfo.hIcon);
// Save the Icon to a file:
icon.SaveToFile('IconFromExe.ico');
// Set the Icon as Application Icon (temporary)
Application.Icon := icon;
finally
Icon.Free;
end;
end;
Bewerten Sie diesen Tipp:
|
|
|