Seite 1 von 1

ExtractIcon_(...) tut nich lange

Verfasst: 13.05.2006 18:13
von Jilocasin
Hi Leute...

Ich bin neu hiä und hab mal ne Frage:

Ich find das klasse, dass man Icons z.B. für ein ListIconG. aus DLLs importieren kann, aber da gibt es bei mir ein kleines Problem:
Wenn ich ExtractIcon_(...) mehrmals nacheinander aufrufe,
kommt als Rückwert nach ungefähr 10x immer ein "leeres" Handle raus. :(

Hier mein Beispiel:

Image_Uebersicht = ExtractIcon_(0,"C:\Windows\System32\Shell32.dll",15)
Image_Anschluesse = ExtractIcon_(0,"C:\Windows\System32\SetupAPI.dll",18 )
Image_Grafik = ExtractIcon_(0,"C:\Windows\System32\SetupAPI.dll",4)
Image_Prozessor = ExtractIcon_(0,"C:\Windows\System32\SetupAPI.dll",21)
Image_Laufwerke = ExtractIcon_(0,"C:\Windows\System32\IDEcoi.dll",4)
Image_CDROM = ExtractIcon_(0,"C:\Windows\System32\IDEcoi.dll",0)
Image_CD = ExtractIcon_(0,"C:\Windows\System32\LTSCR12n.dll",6)
Image_Floppy = ExtractIcon_(0,"C:\Windows\System32\IDEcoi.dll",2)
Image_Win = ExtractIcon_(0,"C:\Windows\System32\XPSP2RES.dll",1)
Image_Drucker = ExtractIcon_(0,"C:\Windows\System32\Shell32.dll",16)
Image_Netzwerk = ExtractIcon_(0,"C:\Windows\System32\NetShell.dll",0)
Image_Speicher = ExtractIcon_(0,"C:\Windows\System32\regwizc.dll",5)
Image_Stromversorgung = ExtractIcon_(0,"C:\Windows\System32\regwizc.dll",5)
Image_Uhrzeit = ExtractIcon_(0,"C:\Windows\System32\mmcndmgr.dll",14)
Image_Info = ExtractIcon_(0,"C:\Windows\System32\Shell32.dll",221)
Image_Free = ExtractIcon_(0,"C:\Windows\System32\Shell32.dll",49)
Image_UnChecked = ExtractIcon_(0,"C:\Windows\System32\CtDetres.dll",8 )
Image_Checked = ExtractIcon_(0,"C:\Windows\System32\CtDetres.dll",9)


Kennt das Problem vielleicht noch wer?

Verfasst: 13.05.2006 18:49
von MVXA
Führ nach jedem ExtractIcon_() einmal Debug GetLastError_() aus.
Irgendwann müsste die != 0 sein. Den Fehlercode kannste in der
MSDN nachsehen.

Dange sehr!

Verfasst: 14.05.2006 08:08
von Jilocasin
Jou!
Hab mein Fehler entdeckt, Danke.

(Jetzt flutschts wie geschmiert... :lol: )