mirror of
https://github.com/reactos/reactos.git
synced 2024-08-05 11:00:55 +00:00
[USER32]
- Simplify finding the icon size in IntDrawState - As a bonus, it now works for black and white icons too svn path=/trunk/; revision=53193
This commit is contained in:
parent
19abe262d6
commit
ef41655991
|
@ -1254,7 +1254,6 @@ IntDrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM lp, WPARAM wp,
|
||||||
if(!cx || !cy)
|
if(!cx || !cy)
|
||||||
{
|
{
|
||||||
SIZE s;
|
SIZE s;
|
||||||
ICONINFO ici;
|
|
||||||
BITMAP bm;
|
BITMAP bm;
|
||||||
|
|
||||||
switch(opcode)
|
switch(opcode)
|
||||||
|
@ -1270,14 +1269,8 @@ IntDrawState(HDC hdc, HBRUSH hbr, DRAWSTATEPROC func, LPARAM lp, WPARAM wp,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DST_ICON:
|
case DST_ICON:
|
||||||
if(!GetIconInfo((HICON)lp, &ici))
|
if(!get_icon_size((HICON)lp, &s))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
if(!GetObjectW(ici.hbmColor, sizeof(bm), &bm))
|
|
||||||
return FALSE;
|
|
||||||
s.cx = bm.bmWidth;
|
|
||||||
s.cy = bm.bmHeight;
|
|
||||||
DeleteObject(ici.hbmMask);
|
|
||||||
DeleteObject(ici.hbmColor);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DST_BITMAP:
|
case DST_BITMAP:
|
||||||
|
|
Loading…
Reference in a new issue