2 * USER initialization code
8 #include "wine/winbase16.h"
21 #include "sysmetrics.h"
26 /***********************************************************************
27 * USER initialisation routine
29 BOOL WINAPI
USER_Init(HINSTANCE hinstDLL
, DWORD fdwReason
, LPVOID lpvReserved
)
34 if ( USER_HeapSel
) return TRUE
;
36 /* Create USER heap */
37 if ((instance
= LoadLibrary16( "USER.EXE" )) < 32) return FALSE
;
38 USER_HeapSel
= GlobalHandleToSel16( instance
);
40 /* Global atom table initialisation */
41 if (!ATOM_Init( USER_HeapSel
)) return FALSE
;
43 /* Initialize window handling (critical section) */
46 /* Initialize system colors and metrics*/
53 /* Initialize window procedures */
54 if (!WINPROC_Init()) return FALSE
;
56 /* Initialize built-in window classes */
57 if (!WIDGETS_Init()) return FALSE
;
59 /* Initialize dialog manager */
60 if (!DIALOG_Init()) return FALSE
;
62 /* Initialize menus */
63 if (!MENU_Init()) return FALSE
;
65 /* Initialize message spying */
66 if (!SPY_Init()) return FALSE
;
68 /* Create system message queue */
69 queueSize
= GetProfileIntA( "windows", "TypeAhead", 120 );
70 if (!QUEUE_CreateSysMsgQueue( queueSize
)) return FALSE
;
72 /* Set double click time */
73 SetDoubleClickTime( GetProfileIntA("windows","DoubleClickSpeed",452) );
75 /* Create message queue of initial thread */
76 InitThreadInput16( 0, 0 );
78 /* Create desktop window */
79 if (!WIN_CreateDesktopWindow()) return FALSE
;
81 /* Initialize keyboard driver */
82 KEYBOARD_Enable( keybd_event
, InputKeyStateTable
);
84 /* Initialize mouse driver */
85 MOUSE_Enable( mouse_event
);
87 /* Start processing X events */
88 UserRepaintDisable16( FALSE
);