Make the icon choice algorithm really choose the best icon.
This commit is contained in:
parent
b47e54d28c
commit
0876700949
|
@ -279,20 +279,16 @@ static BOOL extract_icon32(LPCWSTR szFileName, int nIndex, const char *szXPMFile
|
||||||
{
|
{
|
||||||
for (i = 0; i < pIconDir->idCount; i++)
|
for (i = 0; i < pIconDir->idCount; i++)
|
||||||
{
|
{
|
||||||
if ((pIconDir->idEntries[i].wBitCount >= nMaxBits) && (pIconDir->idEntries[i].wBitCount <= 8))
|
if ((pIconDir->idEntries[i].wBitCount >= nMaxBits) && (pIconDir->idEntries[i].wBitCount <= 8))
|
||||||
{
|
{
|
||||||
if (pIconDir->idEntries[i].wBitCount > nMaxBits)
|
nMaxBits = pIconDir->idEntries[i].wBitCount;
|
||||||
{
|
|
||||||
nMaxBits = pIconDir->idEntries[i].wBitCount;
|
|
||||||
nMax = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth) > nMax)
|
if ((pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth) >= nMax)
|
||||||
{
|
{
|
||||||
lpName = MAKEINTRESOURCEW(pIconDir->idEntries[i].nID);
|
lpName = MAKEINTRESOURCEW(pIconDir->idEntries[i].nID);
|
||||||
nMax = pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth;
|
nMax = pIconDir->idEntries[i].bHeight * pIconDir->idEntries[i].bWidth;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue