LoadPicture gets wrong icon count from dll

Report problems with documented functionality
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

Re: LoadPicture gets wrong icon count from dll

15 Sep 2017, 13:47

Until (or if at all) the glitch is fixed, the following one-liner can be used to get icon count from PE files. (for. ico count will always be 1)

Code: [Select all] [Download] GeSHi © Codebox Plus

IconCount := DllCall( "Shell32\ExtractIcon", "Ptr",0, "Str","broken.dll", "Int",-1 )
User avatar
BGM
Posts: 370
Joined: 20 Nov 2013, 20:56
GitHub: bgmCoder
Contact:

Re: LoadPicture gets wrong icon count from dll

16 Sep 2017, 22:06

Thanks, SKAN, that works like a charm.
Now, what do I do for .icl files?
User avatar
SKAN
Posts: 310
Joined: 29 Sep 2013, 16:58

Re: LoadPicture gets wrong icon count from dll

16 Sep 2017, 22:29

BGM wrote:Now, what do I do for .icl files?


ICL files are NE files. They are 16-bit and last I used them was in Win'98.
If you want to support them, you have to retrieve the raw ICON Data by directly reading from it... Wouldn't be worth the trouble, I'd say.

BTW, ExtractIcon() recognizes .BMP file as an ICON. Also, LoadPicture() is able to load a BMP as HICON when VType parameter is used.

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 1 guest