Details
-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Description
The current test uses zero (0) as the second parameter of ExtractIconExW which is nIconIndex.
Documentation from MS, shows that if this value is -1, it will extract the number of icons.
Any other number will return the number is icons successfully extracted from the file.
So based on this, it appears the second parameter should be -1. I made this change.
Also, the documentation says if the file is an .ico file, the return value is 1.
This seems somewhat odd, but after testing, it appears to be correct.
I added a test for the sysicon.ico which has 6 icons embedded in it.
Another test is that I added was adding explorer.exe which has 18 icons in it to the test.
One other item is that this new code addresses the two main modes of the ExtractIconEx.
One is to find how many icons are present in the file.
The other is to actually extract the icons.
The old test did three (3) tests and this new one does ten (10) tests.
For documentation see:
https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-extracticonexw