From 4f565d6d6cfff95022271dc396ec27da0c4f3833 Mon Sep 17 00:00:00 2001 From: Andreas Mohr Date: Wed, 24 Jan 2001 19:57:04 +0000 Subject: [PATCH] Only set window text for WM_NCCREATE in DefWindowProc*() in case lpszName is a string (i.e. check HIWORD). --- windows/defwnd.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/windows/defwnd.c b/windows/defwnd.c index 91f74e4d4e1..f302ef404ca 100644 --- a/windows/defwnd.c +++ b/windows/defwnd.c @@ -664,7 +664,9 @@ LRESULT WINAPI DefWindowProc16( HWND16 hwnd, UINT16 msg, WPARAM16 wParam, case WM_NCCREATE: { CREATESTRUCT16 *cs = MapSL(lParam); - if (cs->lpszName) + /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP) + * may have child window IDs instead of window name */ + if (HIWORD(cs->lpszName)) DEFWND_SetTextA( wndPtr, MapSL(cs->lpszName) ); result = 1; } @@ -736,7 +738,10 @@ LRESULT WINAPI DefWindowProcA( HWND hwnd, UINT msg, WPARAM wParam, case WM_NCCREATE: { CREATESTRUCTA *cs = (CREATESTRUCTA *)lParam; - if (cs->lpszName) DEFWND_SetTextA( wndPtr, cs->lpszName ); + /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP) + * may have child window IDs instead of window name */ + if (HIWORD(cs->lpszName)) + DEFWND_SetTextA( wndPtr, cs->lpszName ); result = 1; } break; @@ -851,7 +856,10 @@ LRESULT WINAPI DefWindowProcW( case WM_NCCREATE: { CREATESTRUCTW *cs = (CREATESTRUCTW *)lParam; - if (cs->lpszName) DEFWND_SetTextW( wndPtr, cs->lpszName ); + /* check for string, as static icons, bitmaps (SS_ICON, SS_BITMAP) + * may have child window IDs instead of window name */ + if (HIWORD(cs->lpszName)) + DEFWND_SetTextW( wndPtr, cs->lpszName ); result = 1; } break;