Entwickler-Ecke

Windows API - problem mit extracticon


acnut - Fr 03.09.10 18:06
Titel: problem mit extracticon
ich will von jedem prozess das dazugehörende icon in einem lsitview anzeigen und habe das hier gefunden:
http://www.delphi-library.de/topic_Icons+aus+EXE+DLL+oder+ICO+extrahieren_21351,0.html

bekomme aber wegen hinstance diese fehlermeldung:

Delphi-Quelltext
1:
[DCC Fehler] u_win7tool.pas(1433): E2010 Inkompatible Typen: 'string' und 'Cardinal'                    

was muss ich jetzt tun?
und was ist hinstance überhaupt(die delphi hilfe zeigt nichts an:( )

mfg
acnut

Moderiert von user profile iconNarses: Überflüssige Zeilenumbrüche/Leerzeilen entfernt.

---Moderiert von user profile iconNarses: Beiträge zusammengefasst---

habe das jetzt so "gelöst", aber es wird nur dasselbe icon im listview angezeigt

passt irgendwas in der schleife nicht?:


Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
for i := 0 to Listview1.items.Count - 1 do  begin
Process := ProcessInfo1.RunningProcesses.FindByName(ListView1.Items[i].Caption);
      if ExtractIcon(process.ExeFile, ico, 1, false, 1616, LR_DEFAULTCOLOR) then
       begin
         icon:= TIcon.Create;
         icon.Handle:= ico;
         imagelist3.AddIcon(icon);
         icon.Free;
              ListView1.Items[i].ImageIndex:= Imagelist3.Count - 1;
end;
end;



mfg
acnut


SAiBOT - Mo 06.09.10 09:37

In der ShellAPI.pas ist die Funktion richtg deklariert. Denn funktionierts auch mit hInstance.
Zitat:
HINSTANCE
A handle to the instance of the application calling the function.


Delete - Mo 06.09.10 09:56

Habe ich ein Deja vu?
http://www.delphipraxis.net/154286-problem-mit-extracticon.html