- As CURSORICON_FindBestIcon now takes color *bits* count and not color count, fixed the color calculation in LookupIconIdFromDirectoryEx.

svn path=/trunk/; revision=8342
This commit is contained in:
Filip Navara 2004-02-23 22:04:38 +00:00
parent 46d0e1a57c
commit 47d8d8ba89

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: icon.c,v 1.19 2004/02/23 18:16:37 navaraf Exp $ /* $Id: icon.c,v 1.20 2004/02/23 22:04:38 navaraf Exp $
* *
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/icon.c * FILE: lib/user32/windows/icon.c
@ -574,24 +574,22 @@ LookupIconIdFromDirectoryEx(
{ {
GRPCURSORICONDIRENTRY *entry; GRPCURSORICONDIRENTRY *entry;
HDC hdc; HDC hdc;
int colors; int ColorBits;
hdc = GetDC(0); hdc = GetDC(0);
if (Flags & LR_MONOCHROME) if (Flags & LR_MONOCHROME)
{ {
colors = 2; ColorBits = 1;
} }
else else
{ {
colors = GetDeviceCaps(hdc, BITSPIXEL); ColorBits = GetDeviceCaps(hdc, BITSPIXEL);
if (colors > 8) if (ColorBits > 8)
colors = 256; ColorBits = 8;
else
colors = 1 << colors;
} }
ReleaseDC(0, hdc); ReleaseDC(0, hdc);
entry = CURSORICON_FindBestIcon( dir, cxDesired, cyDesired, colors ); entry = CURSORICON_FindBestIcon( dir, cxDesired, cyDesired, ColorBits );
if (entry) if (entry)
retVal = entry->nID; retVal = entry->nID;