[PATCH] Flag unicode structure for user create window

Gerard Patel gerard.patel at nerim.net
Wed Jun 6 15:05:40 CDT 2001


In the CreateWindow user driver function, it is not enough to test the
window procedure to know if the cs structure is unicode or not : the
window can be subclassed, in the cbt hook, for example.

ChangeLog:

	* dlls/x11drv/window.c, dlls/ttydrv/wnd.c, include/user.h, window/win.c
              use a flag to test if create structure is unicode
-------------- next part --------------
Index: dlls/ttydrv/wnd.c
===================================================================
RCS file: /home/wine/wine/dlls/ttydrv/wnd.c,v
retrieving revision 1.10
diff -u -r1.10 wnd.c
--- dlls/ttydrv/wnd.c	2001/06/04 21:55:17	1.10
+++ dlls/ttydrv/wnd.c	2001/06/06 13:52:01
@@ -30,7 +30,7 @@
 /**********************************************************************
  *		CreateWindow   (TTYDRV.@)
  */
-BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs )
+BOOL TTYDRV_CreateWindow( HWND hwnd, CREATESTRUCTA *cs, BOOL unicode )
 {
     BOOL ret;
 
@@ -65,7 +65,7 @@
     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);
Index: dlls/x11drv/window.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/window.c,v
retrieving revision 1.5
diff -u -r1.5 window.c
--- dlls/x11drv/window.c	2001/06/04 21:55:17	1.5
+++ dlls/x11drv/window.c	2001/06/06 13:52:02
@@ -769,7 +769,7 @@
 /**********************************************************************
  *		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 @@
     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 @@
     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);
Index: include/user.h
===================================================================
RCS file: /home/wine/wine/include/user.h,v
retrieving revision 1.23
diff -u -r1.23 user.h
--- include/user.h	2001/06/04 21:55:17	1.23
+++ include/user.h	2001/06/06 13:52:02
@@ -69,7 +69,7 @@
     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);
Index: windows/win.c
===================================================================
RCS file: /home/wine/wine/windows/win.c,v
retrieving revision 1.131
diff -u -r1.131 win.c
--- windows/win.c	2001/06/04 21:55:18	1.131
+++ windows/win.c	2001/06/06 13:52:04
@@ -615,7 +615,7 @@
     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 @@
     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 @@
     }
     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 ));
-------------- next part --------------



More information about the wine-patches mailing list