AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Firemonkey TIcon

Ein Thema von Jonas Shinaniganz · begonnen am 11. Mär 2012 · letzter Beitrag vom 11. Mär 2012
 
Benutzerbild von Jonas Shinaniganz
Jonas Shinaniganz

Registriert seit: 30. Aug 2011
249 Beiträge
 
Delphi XE5 Ultimate
 
#2

AW: Firemonkey TIcon

  Alt 11. Mär 2012, 01:17
Mein eigentliches Problem ist, dass Ich folgenden Code nicht ausführen kann weil TIcon nicht verfügbar ist und Ich nicht weiß wie Ich nun vorgehen soll.
Mein Etappen-Ziel ist es das Icon einer Datei auszulesen. Das ganze soll nicht nur bei Exe Dateien klappen sondern auch bei Files das entsprechende Icon ausgeben.

Delphi-Quellcode:
var
  MyIcon:TIcon;
  icoHandle: HIcon;
begin
  MyIcon:=TIcon.Create;
  try
   icoHandle := ExtractIcon(application.handle,'c:\windows\explorer.exe', 0) ;
   MyIcon.Handle:=icoHandle;
   Image1.Picture.Icon:=MyIcon;
  finally
   MyIcon.free;
  end;
end;
Das hier liefert mir bei Exe Files ein Handle zurück (Jedenfalls nicht 0):

Delphi-Quellcode:
procedure TBarButton.GetIcon;
var
  icoHandle : HIcon;
begin
  icoHandle := ExtractIcon(HInstance, PChar(FShortCut), 0);
end;
In der Hilfe habe ich noch etwas vielversprechenderes gelesen:
Zitat:
SHGFI_ICONLOCATION
Retrieve the name of the file that contains the icon representing the file specified by pszPath, as returned by the IExtractIcon::GetIconLocation method of the file's icon handler. Also retrieve the icon index within that file. The name of the file containing the icon is copied to the szDisplayName member of the structure specified by psfi. The icon's index is copied to that structure's iIcon member.
Das ist Teil von der SHGetFileInfo Function.

Jetzt weiß Ich leider nicht so wirklich weiter... hat jemand einen Ansatz?
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:29 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz