From 0656aaaacdf85d52e74a4ce4bf3a9d0c204b6c2c Mon Sep 17 00:00:00 2001 From: Gregor Schneider Date: Sat, 8 Aug 2009 16:14:43 +0000 Subject: [PATCH] Only set text resource in DefWndProcA on WM_NCCREATE if passed and exists See issue #4766 for more details. svn path=/trunk/; revision=42521 --- reactos/dll/win32/user32/windows/defwnd.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/reactos/dll/win32/user32/windows/defwnd.c b/reactos/dll/win32/user32/windows/defwnd.c index 44f14464679..3ac178b4ba9 100644 --- a/reactos/dll/win32/user32/windows/defwnd.c +++ b/reactos/dll/win32/user32/windows/defwnd.c @@ -1884,13 +1884,17 @@ DefWindowProcA(HWND hWnd, { 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; }