Like the AUTORADIOBUTTON, the parent of a RADIOBUTTON style button
[wine] / dlls / user / user_main.c
1 /*
2  * USER initialization code
3  */
4
5 #include "windef.h"
6 #include "wingdi.h"
7 #include "winuser.h"
8 #include "wine/winbase16.h"
9
10 #include "dce.h"
11 #include "dialog.h"
12 #include "display.h"
13 #include "global.h"
14 #include "input.h"
15 #include "keyboard.h"
16 #include "menu.h"
17 #include "message.h"
18 #include "mouse.h"
19 #include "queue.h"
20 #include "spy.h"
21 #include "sysmetrics.h"
22 #include "user.h"
23 #include "win.h"
24
25
26 /***********************************************************************
27  *           USER initialisation routine
28  */
29 BOOL WINAPI USER_Init(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
30 {
31     HINSTANCE16 instance;
32     int queueSize;
33
34     if ( USER_HeapSel ) return TRUE;
35
36     /* Create USER heap */
37     if ((instance = LoadLibrary16( "USER.EXE" )) < 32) return FALSE;
38     USER_HeapSel = GlobalHandleToSel16( instance );
39
40      /* Global atom table initialisation */
41     if (!ATOM_Init( USER_HeapSel )) return FALSE;
42
43     /* Initialize window handling (critical section) */
44     WIN_Init();
45
46     /* Initialize system colors and metrics*/
47     SYSMETRICS_Init();
48     SYSCOLOR_Init();
49
50     /* Create the DCEs */
51     DCE_Init();
52
53     /* Initialize window procedures */
54     if (!WINPROC_Init()) return FALSE;
55
56     /* Initialize built-in window classes */
57     if (!WIDGETS_Init()) return FALSE;
58
59     /* Initialize dialog manager */
60     if (!DIALOG_Init()) return FALSE;
61
62     /* Initialize menus */
63     if (!MENU_Init()) return FALSE;
64
65     /* Initialize message spying */
66     if (!SPY_Init()) return FALSE;
67
68     /* Create system message queue */
69     queueSize = GetProfileIntA( "windows", "TypeAhead", 120 );
70     if (!QUEUE_CreateSysMsgQueue( queueSize )) return FALSE;
71
72     /* Set double click time */
73     SetDoubleClickTime( GetProfileIntA("windows","DoubleClickSpeed",452) );
74
75     /* Create message queue of initial thread */
76     InitThreadInput16( 0, 0 );
77
78     /* Create desktop window */
79     if (!WIN_CreateDesktopWindow()) return FALSE;
80
81     /* Initialize keyboard driver */
82     KEYBOARD_Enable( keybd_event, InputKeyStateTable );
83
84     /* Initialize mouse driver */
85     MOUSE_Enable( mouse_event );
86
87     /* Start processing X events */
88     UserRepaintDisable16( FALSE );
89
90     return TRUE;
91 }