[ros-diffs] [gschneider] 42521: Only set text resource in DefWndProcA on WM_NCCREATE if passed and exists See issue #4766 for more details.

gschneider at svn.reactos.org gschneider at svn.reactos.org
Sat Aug 8 18:14:43 CEST 2009


Author: gschneider
Date: Sat Aug  8 18:14:43 2009
New Revision: 42521

URL: http://svn.reactos.org/svn/reactos?rev=42521&view=rev
Log:
Only set text resource in DefWndProcA on WM_NCCREATE if passed and exists
See issue #4766 for more details.

Modified:
    trunk/reactos/dll/win32/user32/windows/defwnd.c

Modified: trunk/reactos/dll/win32/user32/windows/defwnd.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/user32/windows/defwnd.c?rev=42521&r1=42520&r2=42521&view=diff
==============================================================================
--- trunk/reactos/dll/win32/user32/windows/defwnd.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/user32/windows/defwnd.c [iso-8859-1] Sat Aug  8 18:14:43 2009
@@ -1884,13 +1884,17 @@
     {
         case WM_NCCREATE:
         {
-            LPCREATESTRUCTA cs = (LPCREATESTRUCTA)lParam;
-            /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
-             * may have child window IDs instead of window name */
-
-             DefSetText(hWnd, (PCWSTR)cs->lpszName, TRUE);
-
-            Result = 1;
+            if (lParam)
+            {
+                LPCREATESTRUCTA cs = (LPCREATESTRUCTA)lParam;
+                /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP)
+                 * may have child window IDs instead of window name */
+                if (HIWORD(cs->lpszName))
+                {
+                    DefSetText(hWnd, (PCWSTR)cs->lpszName, TRUE);
+                }
+                Result = 1;
+            }
             break;
         }
 




More information about the Ros-diffs mailing list