diff --git a/dlls/user32/class.c b/dlls/user32/class.c index eee9c1de5fd..94bc639a23a 100644 --- a/dlls/user32/class.c +++ b/dlls/user32/class.c @@ -433,17 +433,11 @@ void CLASS_RegisterBuiltinClasses(void) /*********************************************************************** - * CLASS_AddWindow - * - * Add a new window using this class, and set the necessary - * information inside the window structure. + * get_class_winproc */ -void CLASS_AddWindow( CLASS *class, WND *win, BOOL unicode ) +WNDPROC get_class_winproc( CLASS *class ) { - win->class = class; - win->clsStyle = class->style; - win->winproc = class->winproc; - if (WINPROC_IsUnicode( win->winproc, unicode )) win->flags |= WIN_ISUNICODE; + return class->winproc; } diff --git a/dlls/user32/controls.h b/dlls/user32/controls.h index 812710cdd5e..ef564324580 100644 --- a/dlls/user32/controls.h +++ b/dlls/user32/controls.h @@ -63,7 +63,7 @@ struct tagCLASS; /* opaque structure */ struct tagWND; extern ATOM get_int_atom_value( LPCWSTR name ) DECLSPEC_HIDDEN; extern void CLASS_RegisterBuiltinClasses(void) DECLSPEC_HIDDEN; -extern void CLASS_AddWindow( struct tagCLASS *class, struct tagWND *win, BOOL unicode ) DECLSPEC_HIDDEN; +extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN; extern void CLASS_FreeModuleClasses( HMODULE16 hModule ) DECLSPEC_HIDDEN; /* defwnd proc */ diff --git a/dlls/user32/win.c b/dlls/user32/win.c index 8e02a5dcd2c..f5fee96b804 100644 --- a/dlls/user32/win.c +++ b/dlls/user32/win.c @@ -133,7 +133,8 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name, return NULL; } - if (!(win = HeapAlloc( GetProcessHeap(), 0, sizeof(WND) + extra_bytes - sizeof(win->wExtra) ))) + if (!(win = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, + sizeof(WND) + extra_bytes - sizeof(win->wExtra) ))) { SERVER_START_REQ( destroy_window ) { @@ -163,13 +164,11 @@ static WND *create_window_handle( HWND parent, HWND owner, LPCWSTR name, win->hwndSelf = handle; win->parent = full_parent; win->owner = full_owner; + win->class = class; + win->winproc = get_class_winproc( class ); win->dwMagic = WND_MAGIC; - win->flags = 0; win->cbWndExtra = extra_bytes; - SetRectEmpty( &win->rectWindow ); - SetRectEmpty( &win->rectClient ); - memset( win->wExtra, 0, extra_bytes ); - CLASS_AddWindow( class, win, unicode ); + if (WINPROC_IsUnicode( win->winproc, unicode )) win->flags |= WIN_ISUNICODE; return win; } diff --git a/include/win.h b/include/win.h index ac6b753b719..baa8c6d7345 100644 --- a/include/win.h +++ b/include/win.h @@ -49,7 +49,6 @@ typedef struct tagWND void *pHScroll; /* Horizontal scroll-bar info */ DWORD dwStyle; /* Window style (from CreateWindow) */ DWORD dwExStyle; /* Extended style (from CreateWindowEx) */ - DWORD clsStyle; /* Class style at window creation */ UINT_PTR wIDmenu; /* ID or hmenu (from CreateWindow) */ DWORD helpContext; /* Help context ID */ UINT flags; /* Misc. flags (see below) */