From ad363030a116d515fbff8711b8cdc3340be91c86 Mon Sep 17 00:00:00 2001 From: Gerard Patel Date: Wed, 6 Jun 2001 21:26:50 +0000 Subject: [PATCH] Use a flag to test if create structure is unicode. --- dlls/ttydrv/ttydrv.spec | 2 +- dlls/ttydrv/wnd.c | 4 ++-- dlls/x11drv/window.c | 6 +++--- dlls/x11drv/x11drv.spec | 2 +- include/user.h | 2 +- windows/win.c | 5 +++-- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/dlls/ttydrv/ttydrv.spec b/dlls/ttydrv/ttydrv.spec index 8a14613f7f4..00675d2c35a 100644 --- a/dlls/ttydrv/ttydrv.spec +++ b/dlls/ttydrv/ttydrv.spec @@ -27,7 +27,7 @@ debug_channels (ttydrv) @ cdecl GetScreenSaveTimeout() TTYDRV_GetScreenSaveTimeout @ cdecl SetScreenSaveTimeout(long) TTYDRV_SetScreenSaveTimeout @ cdecl LoadOEMResource(long long) TTYDRV_LoadOEMResource -@ cdecl CreateWindow(long ptr) TTYDRV_CreateWindow +@ cdecl CreateWindow(long ptr long) TTYDRV_CreateWindow @ cdecl DestroyWindow(long) TTYDRV_DestroyWindow @ cdecl GetDC(long long long long) TTYDRV_GetDC @ cdecl SetWindowPos(ptr) TTYDRV_SetWindowPos diff --git a/dlls/ttydrv/wnd.c b/dlls/ttydrv/wnd.c index b0ae7e11d0e..09e72445e16 100644 --- a/dlls/ttydrv/wnd.c +++ b/dlls/ttydrv/wnd.c @@ -30,7 +30,7 @@ WND_DRIVER TTYDRV_WND_Driver = /********************************************************************** * CreateWindow (TTYDRV.@) */ -BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs ) +BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) { BOOL ret; @@ -65,7 +65,7 @@ BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs ) FIXME("(%x): stub\n", hwnd); #endif /* defined(WINE_CURSES) */ - if (IsWindowUnicode( hwnd )) + if (unicode) { ret = SendMessageW( hwnd, WM_NCCREATE, 0, (LPARAM)cs ); if (ret) ret = (SendMessageW( hwnd, WM_CREATE, 0, (LPARAM)cs ) != -1); diff --git a/dlls/x11drv/window.c b/dlls/x11drv/window.c index 2b54382648d..da943d4d947 100644 --- a/dlls/x11drv/window.c +++ b/dlls/x11drv/window.c @@ -769,7 +769,7 @@ BOOL X11DRV_DestroyWindow( HWND hwnd ) /********************************************************************** * CreateWindow (X11DRV.@) */ -BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs ) +BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode ) { Display *display = thread_display(); WND *wndPtr; @@ -788,7 +788,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs ) wndPtr->flags |= WIN_NATIVE; WIN_ReleaseWndPtr( wndPtr ); - if (IsWindowUnicode( hwnd )) + if (unicode) ret = SendMessageW( hwnd, WM_NCCREATE, 0, (LPARAM)cs ); else ret = SendMessageA( hwnd, WM_NCCREATE, 0, (LPARAM)cs ); @@ -830,7 +830,7 @@ BOOL X11DRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs ) X11DRV_register_window( display, hwnd, data ); WIN_ReleaseWndPtr( wndPtr ); - if (IsWindowUnicode( hwnd )) + if (unicode) ret = (SendMessageW( hwnd, WM_CREATE, 0, (LPARAM)cs ) != -1); else ret = (SendMessageA( hwnd, WM_CREATE, 0, (LPARAM)cs ) != -1); diff --git a/dlls/x11drv/x11drv.spec b/dlls/x11drv/x11drv.spec index 70d3aa34e5e..d850234b3e3 100644 --- a/dlls/x11drv/x11drv.spec +++ b/dlls/x11drv/x11drv.spec @@ -27,7 +27,7 @@ debug_channels (bitblt bitmap clipboard cursor dinput event font gdi graphics @ cdecl GetScreenSaveTimeout() X11DRV_GetScreenSaveTimeout @ cdecl SetScreenSaveTimeout(long) X11DRV_SetScreenSaveTimeout @ cdecl LoadOEMResource(long long) X11DRV_LoadOEMResource -@ cdecl CreateWindow(long ptr) X11DRV_CreateWindow +@ cdecl CreateWindow(long ptr long) X11DRV_CreateWindow @ cdecl DestroyWindow(long) X11DRV_DestroyWindow @ cdecl GetDC(long long long long) X11DRV_GetDC @ cdecl EnableWindow(long long) X11DRV_EnableWindow diff --git a/include/user.h b/include/user.h index 51d45ac8468..8d0355d0b9f 100644 --- a/include/user.h +++ b/include/user.h @@ -69,7 +69,7 @@ typedef struct tagUSER_DRIVER { void (*pResetSelectionOwner)(struct tagWND *, BOOL); /* windowing functions */ - BOOL (*pCreateWindow)(HWND,CREATESTRUCTA*); + BOOL (*pCreateWindow)(HWND,CREATESTRUCTA*,BOOL); BOOL (*pDestroyWindow)(HWND); BOOL (*pGetDC)(HWND,HDC,HRGN,DWORD); BOOL (*pEnableWindow)(HWND,BOOL); diff --git a/windows/win.c b/windows/win.c index 0ad24dce579..ab43058e1f7 100644 --- a/windows/win.c +++ b/windows/win.c @@ -615,7 +615,7 @@ BOOL WIN_CreateDesktopWindow(void) cs.lpszName = NULL; cs.lpszClass = DESKTOP_CLASS_ATOM; - if (!USER_Driver.pCreateWindow( hwndDesktop, &cs )) return FALSE; + if (!USER_Driver.pCreateWindow( hwndDesktop, &cs, FALSE )) return FALSE; pWndDesktop->flags |= WIN_NEEDS_ERASEBKGND; return TRUE; @@ -704,6 +704,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, DWORD clsStyle; WNDPROC winproc; DCE *dce; + BOOL unicode = (type == WIN_PROC_32W); TRACE("%s %s %08lx %08lx %d,%d %dx%d %04x %04x %08x %p\n", (type == WIN_PROC_32W) ? debugres_w((LPWSTR)cs->lpszName) : debugres_a(cs->lpszName), @@ -894,7 +895,7 @@ static HWND WIN_CreateWindowEx( CREATESTRUCTA *cs, ATOM classAtom, } else wndPtr->wIDmenu = (UINT)cs->hMenu; - if (!USER_Driver.pCreateWindow( wndPtr->hwndSelf, cs )) + if (!USER_Driver.pCreateWindow( wndPtr->hwndSelf, cs, unicode)) { WARN("aborted by WM_xxCREATE!\n"); WIN_ReleaseWndPtr(WIN_DestroyWindow( wndPtr ));