Apply changes from r42521 to DefWndProcW as well
authorGregor Schneider <grschneider@gmail.com>
Sat, 15 Aug 2009 22:06:09 +0000 (22:06 +0000)
committerGregor Schneider <grschneider@gmail.com>
Sat, 15 Aug 2009 22:06:09 +0000 (22:06 +0000)
See issue #4791 for more details.

svn path=/trunk/; revision=42718

reactos/dll/win32/user32/windows/defwnd.c

index 3ac178b..e6ef792 100644 (file)
@@ -2037,12 +2037,18 @@ DefWindowProcW(HWND hWnd,
     {
         case WM_NCCREATE:
         {
-            LPCREATESTRUCTW cs = (LPCREATESTRUCTW)lParam;
-            /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
-             * may have child window IDs instead of window name */
+            if (lParam)
+            {
+                LPCREATESTRUCTW cs = (LPCREATESTRUCTW)lParam;
+                /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
+                 * may have child window IDs instead of window name */
 
-            DefSetText(hWnd, cs->lpszName, FALSE);
-            Result = 1;
+                if (HIWORD(cs->lpszName))
+                {
+                    DefSetText(hWnd, cs->lpszName, FALSE);
+                }
+                Result = 1;
+            }
             break;
         }