Make the icon choice algorithm really choose the best icon.

This commit is contained in:
Maxime Bellengé 2005-08-22 09:17:25 +00:00 committed by Alexandre Julliard
parent b47e54d28c
commit 0876700949
1 changed files with 9 additions and 13 deletions

View File

@ -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;
} }
}
} }
} }