[ros-diffs] [jgardou] 47143: [WIN32K] - 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

jgardou at svn.reactos.org jgardou at svn.reactos.org
Sun May 9 15:07:48 CEST 2010


Author: jgardou
Date: Sun May  9 15:07:47 2010
New Revision: 47143

URL: http://svn.reactos.org/svn/reactos?rev=47143&view=rev
Log:
[WIN32K]
  - 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

Modified:
    branches/reactos-yarotows/dll/win32/user32/windows/class.c
    branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c

Modified: branches/reactos-yarotows/dll/win32/user32/windows/class.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/dll/win32/user32/windows/class.c?rev=47143&r1=47142&r2=47143&view=diff
==============================================================================
--- branches/reactos-yarotows/dll/win32/user32/windows/class.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/dll/win32/user32/windows/class.c [iso-8859-1] Sun May  9 15:07:47 2010
@@ -289,7 +289,7 @@
      }
      return Ret;
   }
-  // Wine Class tests: 
+  // Wine Class tests:
   /*  Edit controls are special - they return a wndproc handle when
       GetWindowLongPtr is called with a different A/W.
       On the other hand there is no W->A->W conversion so this control
@@ -809,7 +809,6 @@
    int SmallIconWidth;
    int SmallIconHeight;
    BITMAP StdBitmapInfo;
-   HDC hInfoDc = NULL;
    HDC hSourceDc = NULL;
    HDC hDestDc = NULL;
    ICONINFO SmallInfo;
@@ -845,15 +844,6 @@
       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);
    if (NULL == hSourceDc)
    {
@@ -873,7 +863,7 @@
       ERR("Failed to select source color bitmap\n");
       goto cleanup;
    }
-   SmallInfo.hbmColor = CreateCompatibleBitmap(hInfoDc, SmallIconWidth,
+   SmallInfo.hbmColor = CreateCompatibleBitmap(hSourceDc, SmallIconWidth,
                                               SmallIconHeight);
    if (NULL == SmallInfo.hbmColor)
    {
@@ -899,8 +889,7 @@
       ERR("Failed to select source mask bitmap\n");
       goto cleanup;
    }
-   SmallInfo.hbmMask = CreateBitmap(SmallIconWidth, SmallIconHeight, 1, 1,
-                                    NULL);
+   SmallInfo.hbmMask = CreateCompatibleBitmap(hSourceDc, SmallIconWidth, SmallIconHeight);
    if (NULL == SmallInfo.hbmMask)
    {
       ERR("Failed to create mask bitmap\n");
@@ -953,10 +942,6 @@
    if (NULL != hSourceDc)
    {
       DeleteDC(hSourceDc);
-   }
-   if (NULL != hInfoDc)
-   {
-      DeleteDC(hInfoDc);
    }
 
    return SmallIcon;
@@ -1048,9 +1033,9 @@
    clsMenuName.pszClientAnsiMenuName = AnsiMenuName.Buffer;
    clsMenuName.pwszClientUnicodeMenuName = MenuName.Buffer;
    clsMenuName.pusMenuName = &MenuName;
-   
+
    Atom = NtUserRegisterClassExWOW( &WndClass,
-                                    &ClassName,  
+                                    &ClassName,
                                      NULL, //PUNICODE_STRING ClsNVersion,
                                     &clsMenuName,
                                      fnID,

Modified: branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c
URL: http://svn.reactos.org/svn/reactos/branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c?rev=47143&r1=47142&r2=47143&view=diff
==============================================================================
--- branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] (original)
+++ branches/reactos-yarotows/subsystems/win32/win32k/objects/bitmaps.c [iso-8859-1] Sun May  9 15:07:47 2010
@@ -166,19 +166,6 @@
             {
                 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),
                                              abs(Height),
                                              dibs.dsBm.bmPlanes,




More information about the Ros-diffs mailing list