From: Sven Baars sbaars@codeweavers.com
This partially reverts e41c255be6ba66d1eec7affe674b8cc7699226b8.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53568 Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=53646 --- dlls/user32/win.c | 4 +++- dlls/win32u/window.c | 16 +++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/win.c b/dlls/user32/win.c index d8869b2b9db..5682fe58f7b 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -281,6 +281,7 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, UNICODE_STRING class, window_name = {0}; HWND hwnd, top_child = 0; MDICREATESTRUCTW mdi_cs; + CBT_CREATEWNDW cbtc; WNDCLASSEXW info; WCHAR name_buf[8]; HMENU menu; @@ -397,9 +398,10 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module, if (!menu && info.lpszMenuName && (cs->style & (WS_CHILD | WS_POPUP)) != WS_CHILD) menu = LoadMenuW( cs->hInstance, info.lpszMenuName );
+ cbtc.lpcs = cs; hwnd = NtUserCreateWindowEx( cs->dwExStyle, &class, NULL, &window_name, cs->style, cs->x, cs->y, cs->cx, cs->cy, cs->hwndParent, menu, module, - cs->lpCreateParams, 0, NULL, 0, !unicode ); + cs->lpCreateParams, 0, &cbtc, 0, !unicode ); if (!hwnd && menu && menu != cs->hMenu) NtUserDestroyMenu( menu ); if (!unicode && window_name.Buffer != name_buf) RtlFreeUnicodeString( &window_name ); return hwnd; diff --git a/dlls/win32u/window.c b/dlls/win32u/window.c index a64a6220026..b6bea6f89d6 100644 --- a/dlls/win32u/window.c +++ b/dlls/win32u/window.c @@ -5035,14 +5035,24 @@ HWND WINAPI NtUserCreateWindowEx( DWORD ex_style, UNICODE_STRING *class_name,
static const WCHAR messageW[] = {'M','e','s','s','a','g','e'};
+ if (client_cbtc) + { + cs.lpszName = client_cbtc->lpcs->lpszName; /* strings may be ansi */ + cs.lpszClass = client_cbtc->lpcs->lpszClass; + cs.hInstance = client_cbtc->lpcs->hInstance; /* may be different than instance for win16 */ + } + else + { + cs.lpszName = window_name ? window_name->Buffer : NULL; + cs.lpszClass = class_name->Buffer; + cs.hInstance = instance; + } + cs.lpCreateParams = params; - cs.hInstance = instance; cs.hMenu = menu; cs.hwndParent = parent; cs.style = style; cs.dwExStyle = ex_style; - cs.lpszName = window_name ? window_name->Buffer : NULL; - cs.lpszClass = class_name ? class_name->Buffer : NULL; cs.x = x; cs.y = y; cs.cx = cx;