Page 2 of 2

Re: LoadPicture gets wrong icon count from dll

Posted: 15 Sep 2017, 13:47
by SKAN
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

IconCount := DllCall( "Shell32\ExtractIcon", "Ptr",0, "Str","broken.dll", "Int",-1 )

Re: LoadPicture gets wrong icon count from dll

Posted: 16 Sep 2017, 22:06
by BGM
Thanks, SKAN, that works like a charm.
Now, what do I do for .icl files?

Re: LoadPicture gets wrong icon count from dll

Posted: 16 Sep 2017, 22:29
by SKAN
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.

Re: LoadPicture gets wrong icon count from dll

Posted: 17 Dec 2017, 03:22
by lexikos
SKAN wrote:Until (or if at all) the glitch is fixed,
I may be wrong since I haven't done more than skimmed over the thread, but I think I fixed it back in July. I just haven't been interested enough to release an update. (Just a little longer.)

Re: LoadPicture gets wrong icon count from dll  Topic is solved

Posted: 27 Dec 2017, 04:47
by lexikos
Fixed in v1.1.27.00.