- remove a comment which is not true anymore
[USER32]
  - Create a bitmap which is compatible with the bitmap'we are copying in CreateSmallIcon
Icons are back in taskbar

svn path=/branches/reactos-yarotows/; revision=47143
This commit is contained in:
Jérôme Gardou 2010-05-09 13:07:47 +00:00
parent c3f13756b2
commit 38a2853dc1
2 changed files with 5 additions and 33 deletions

View file

@ -289,7 +289,7 @@ IntGetWndProc(PWND pWnd, BOOL Ansi)
} }
return Ret; return Ret;
} }
// Wine Class tests: // Wine Class tests:
/* Edit controls are special - they return a wndproc handle when /* Edit controls are special - they return a wndproc handle when
GetWindowLongPtr is called with a different A/W. GetWindowLongPtr is called with a different A/W.
On the other hand there is no W->A->W conversion so this control On the other hand there is no W->A->W conversion so this control
@ -809,7 +809,6 @@ CreateSmallIcon(HICON StdIcon)
int SmallIconWidth; int SmallIconWidth;
int SmallIconHeight; int SmallIconHeight;
BITMAP StdBitmapInfo; BITMAP StdBitmapInfo;
HDC hInfoDc = NULL;
HDC hSourceDc = NULL; HDC hSourceDc = NULL;
HDC hDestDc = NULL; HDC hDestDc = NULL;
ICONINFO SmallInfo; ICONINFO SmallInfo;
@ -845,15 +844,6 @@ CreateSmallIcon(HICON StdIcon)
return StdIcon; return StdIcon;
} }
/* Get a handle to a info DC and handles to DCs which can be used to
select a bitmap into. This is done to avoid triggering a switch to
graphics mode (if we're currently in text/blue screen mode) */
hInfoDc = CreateICW(NULL, NULL, NULL, NULL);
if (NULL == hInfoDc)
{
ERR("Failed to create info DC\n");
goto cleanup;
}
hSourceDc = CreateCompatibleDC(NULL); hSourceDc = CreateCompatibleDC(NULL);
if (NULL == hSourceDc) if (NULL == hSourceDc)
{ {
@ -873,7 +863,7 @@ CreateSmallIcon(HICON StdIcon)
ERR("Failed to select source color bitmap\n"); ERR("Failed to select source color bitmap\n");
goto cleanup; goto cleanup;
} }
SmallInfo.hbmColor = CreateCompatibleBitmap(hInfoDc, SmallIconWidth, SmallInfo.hbmColor = CreateCompatibleBitmap(hSourceDc, SmallIconWidth,
SmallIconHeight); SmallIconHeight);
if (NULL == SmallInfo.hbmColor) if (NULL == SmallInfo.hbmColor)
{ {
@ -899,8 +889,7 @@ CreateSmallIcon(HICON StdIcon)
ERR("Failed to select source mask bitmap\n"); ERR("Failed to select source mask bitmap\n");
goto cleanup; goto cleanup;
} }
SmallInfo.hbmMask = CreateBitmap(SmallIconWidth, SmallIconHeight, 1, 1, SmallInfo.hbmMask = CreateCompatibleBitmap(hSourceDc, SmallIconWidth, SmallIconHeight);
NULL);
if (NULL == SmallInfo.hbmMask) if (NULL == SmallInfo.hbmMask)
{ {
ERR("Failed to create mask bitmap\n"); ERR("Failed to create mask bitmap\n");
@ -954,10 +943,6 @@ cleanup:
{ {
DeleteDC(hSourceDc); DeleteDC(hSourceDc);
} }
if (NULL != hInfoDc)
{
DeleteDC(hInfoDc);
}
return SmallIcon; return SmallIcon;
} }
@ -1048,9 +1033,9 @@ RegisterClassExWOWW(WNDCLASSEXW *lpwcx,
clsMenuName.pszClientAnsiMenuName = AnsiMenuName.Buffer; clsMenuName.pszClientAnsiMenuName = AnsiMenuName.Buffer;
clsMenuName.pwszClientUnicodeMenuName = MenuName.Buffer; clsMenuName.pwszClientUnicodeMenuName = MenuName.Buffer;
clsMenuName.pusMenuName = &MenuName; clsMenuName.pusMenuName = &MenuName;
Atom = NtUserRegisterClassExWOW( &WndClass, Atom = NtUserRegisterClassExWOW( &WndClass,
&ClassName, &ClassName,
NULL, //PUNICODE_STRING ClsNVersion, NULL, //PUNICODE_STRING ClsNVersion,
&clsMenuName, &clsMenuName,
fnID, fnID,

View file

@ -166,19 +166,6 @@ IntCreateCompatibleBitmap(
{ {
if (Count == sizeof(BITMAP)) if (Count == sizeof(BITMAP))
{ {
/* We have a bitmap bug!!! W/O the HACK, we have white icons.
MSDN Note: When a memory device context is created, it initially
has a 1-by-1 monochrome bitmap selected into it. If this memory
device context is used in CreateCompatibleBitmap, the bitmap that
is created is a monochrome bitmap. To create a color bitmap, use
the hDC that was used to create the memory device context, as
shown in the following code:
HDC memDC = CreateCompatibleDC(hDC);
HBITMAP memBM = CreateCompatibleBitmap(hDC, nWidth, nHeight);
SelectObject(memDC, memBM);
*/
Bmp = IntGdiCreateBitmap(abs(Width), Bmp = IntGdiCreateBitmap(abs(Width),
abs(Height), abs(Height),
dibs.dsBm.bmPlanes, dibs.dsBm.bmPlanes,