Commit fe441a06 authored by Alexandre Julliard's avatar Alexandre Julliard

user32: Register classes once the graphics driver has been loaded, except for the desktop class.

parent e4a43cfa
......@@ -369,7 +369,7 @@ static void register_builtin( const struct builtin_class_descr *descr )
if (!(classPtr = CLASS_RegisterClass( descr->name, user32_module, FALSE,
descr->style, 0, descr->extra ))) return;
classPtr->hCursor = LoadCursorA( 0, (LPSTR)descr->cursor );
if (descr->cursor) classPtr->hCursor = LoadCursorA( 0, (LPSTR)descr->cursor );
classPtr->hbrBackground = descr->brush;
classPtr->winproc = BUILTIN_WINPROC( descr->proc );
release_class_ptr( classPtr );
......@@ -381,7 +381,6 @@ static void register_builtin( const struct builtin_class_descr *descr )
*/
static BOOL WINAPI register_builtins( INIT_ONCE *once, void *param, void **context )
{
register_builtin( &DESKTOP_builtin_class );
register_builtin( &BUTTON_builtin_class );
register_builtin( &COMBO_builtin_class );
register_builtin( &COMBOLBOX_builtin_class );
......@@ -391,7 +390,6 @@ static BOOL WINAPI register_builtins( INIT_ONCE *once, void *param, void **conte
register_builtin( &LISTBOX_builtin_class );
register_builtin( &MDICLIENT_builtin_class );
register_builtin( &MENU_builtin_class );
register_builtin( &MESSAGE_builtin_class );
register_builtin( &SCROLL_builtin_class );
register_builtin( &STATIC_builtin_class );
return TRUE;
......@@ -399,15 +397,25 @@ static BOOL WINAPI register_builtins( INIT_ONCE *once, void *param, void **conte
/***********************************************************************
* CLASS_RegisterBuiltinClasses
* register_builtin_classes
*/
void CLASS_RegisterBuiltinClasses(void)
void register_builtin_classes(void)
{
InitOnceExecuteOnce( &init_once, register_builtins, NULL, NULL );
}
/***********************************************************************
* register_desktop_class
*/
void register_desktop_class(void)
{
register_builtin( &DESKTOP_builtin_class );
register_builtin( &MESSAGE_builtin_class );
}
/***********************************************************************
* get_class_winproc
*/
WNDPROC get_class_winproc( CLASS *class )
......
......@@ -139,7 +139,8 @@ extern ULONG_PTR set_icon_param( HICON handle, ULONG_PTR param ) DECLSPEC_HIDDEN
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 register_builtin_classes(void) DECLSPEC_HIDDEN;
extern void register_desktop_class(void) DECLSPEC_HIDDEN;
extern WNDPROC get_class_winproc( struct tagCLASS *class ) DECLSPEC_HIDDEN;
extern struct dce *get_class_dce( struct tagCLASS *class ) DECLSPEC_HIDDEN;
extern struct dce *set_class_dce( struct tagCLASS *class, struct dce *dce ) DECLSPEC_HIDDEN;
......
......@@ -48,7 +48,7 @@ const struct builtin_class_descr DESKTOP_builtin_class =
CS_DBLCLKS, /* style */
WINPROC_DESKTOP, /* proc */
0, /* extra */
IDC_ARROW, /* cursor */
0, /* cursor */
(HBRUSH)(COLOR_BACKGROUND+1) /* brush */
};
......
......@@ -28,6 +28,7 @@
#include "wine/gdi_driver.h"
#include "user_private.h"
#include "controls.h"
static USER_DRIVER null_driver, lazy_load_driver;
......@@ -119,6 +120,8 @@ static const USER_DRIVER *load_driver(void)
}
else LdrAddRefDll( 0, graphics_driver );
register_builtin_classes();
DeleteDC( hdc );
return driver;
}
......
......@@ -290,7 +290,7 @@ const struct builtin_class_descr MESSAGE_builtin_class =
0, /* style */
WINPROC_MESSAGE, /* proc */
0, /* extra */
IDC_ARROW, /* cursor */
0, /* cursor */
0 /* brush */
};
......
......@@ -262,6 +262,8 @@ static void winstation_init(void)
if (handle) SetThreadDesktop( handle );
}
HeapFree( GetProcessHeap(), 0, buffer );
register_desktop_class();
}
......
......@@ -1391,8 +1391,6 @@ HWND WIN_CreateWindowEx( CREATESTRUCTW *cs, LPCWSTR className, HINSTANCE module,
}
}
CLASS_RegisterBuiltinClasses();
/* Find the parent window */
parent = cs->hwndParent;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment