[YAROTOWS] Reintegrate the branch. For a brighter future.
[reactos.git] / reactos / dll / win32 / user32 / windows / class.c
index d55d29c..70171c6 100644 (file)
@@ -298,7 +298,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
       GetWindowLongPtr is called with a different A/W.
       On the other hand there is no W->A->W conversion so this control
   /*  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
@@ -831,7 +831,6 @@ CreateSmallIcon(HICON StdIcon)
    int SmallIconWidth;
    int SmallIconHeight;
    BITMAP StdBitmapInfo;
    int SmallIconWidth;
    int SmallIconHeight;
    BITMAP StdBitmapInfo;
-   HDC hInfoDc = NULL;
    HDC hSourceDc = NULL;
    HDC hDestDc = NULL;
    ICONINFO SmallInfo;
    HDC hSourceDc = NULL;
    HDC hDestDc = NULL;
    ICONINFO SmallInfo;
@@ -867,15 +866,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);
    if (NULL == hSourceDc)
    {
    hSourceDc = CreateCompatibleDC(NULL);
    if (NULL == hSourceDc)
    {
@@ -895,7 +885,7 @@ CreateSmallIcon(HICON StdIcon)
       ERR("Failed to select source color bitmap\n");
       goto cleanup;
    }
       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)
    {
                                               SmallIconHeight);
    if (NULL == SmallInfo.hbmColor)
    {
@@ -921,8 +911,7 @@ CreateSmallIcon(HICON StdIcon)
       ERR("Failed to select source mask bitmap\n");
       goto cleanup;
    }
       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");
    if (NULL == SmallInfo.hbmMask)
    {
       ERR("Failed to create mask bitmap\n");
@@ -976,10 +965,6 @@ cleanup:
    {
       DeleteDC(hSourceDc);
    }
    {
       DeleteDC(hSourceDc);
    }
-   if (NULL != hInfoDc)
-   {
-      DeleteDC(hInfoDc);
-   }
 
    return SmallIcon;
 }
 
    return SmallIcon;
 }
@@ -1070,9 +1055,9 @@ RegisterClassExWOWW(WNDCLASSEXW *lpwcx,
    clsMenuName.pszClientAnsiMenuName = AnsiMenuName.Buffer;
    clsMenuName.pwszClientUnicodeMenuName = MenuName.Buffer;
    clsMenuName.pusMenuName = &MenuName;
    clsMenuName.pszClientAnsiMenuName = AnsiMenuName.Buffer;
    clsMenuName.pwszClientUnicodeMenuName = MenuName.Buffer;
    clsMenuName.pusMenuName = &MenuName;
-   
+
    Atom = NtUserRegisterClassExWOW( &WndClass,
    Atom = NtUserRegisterClassExWOW( &WndClass,
-                                    &ClassName,  
+                                    &ClassName,
                                      NULL, //PUNICODE_STRING ClsNVersion,
                                     &clsMenuName,
                                      fnID,
                                      NULL, //PUNICODE_STRING ClsNVersion,
                                     &clsMenuName,
                                      fnID,