user32: Simplify the window structure creation. Get rid of the unused clsStyle field.

This commit is contained in:
Alexandre Julliard 2008-02-25 15:55:17 +01:00
parent 5579d2f995
commit 4273a8ab86
4 changed files with 9 additions and 17 deletions

View File

@ -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;
}

View File

@ -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 */

View File

@ -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;
}

View File

@ -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) */