Release 940505
[wine] / misc / user.c
1 static char RCSId[] = "$Id: user.c,v 1.2 1993/07/04 04:04:21 root Exp root $";
2 static char Copyright[] = "Copyright  Robert J. Amstadt, 1993";
3
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include "prototypes.h"
7 #include "windows.h"
8 #include "user.h"
9 #include "message.h"
10
11 #define USER_HEAP_SIZE          0x10000
12
13
14 MDESC *USER_Heap = NULL;
15
16
17 extern BOOL ATOM_Init();
18 extern BOOL GDI_Init();
19 extern void SYSMETRICS_Init();
20 extern BOOL WIN_CreateDesktopWindow();
21
22 #ifndef WINELIB
23 /***********************************************************************
24  *           USER_HeapInit
25  */
26 static BOOL USER_HeapInit()
27 {
28     struct segment_descriptor_s * s;
29     s = GetNextSegment( 0, 0x10000 );
30     if (s == NULL) return FALSE;
31     HEAP_Init( &USER_Heap, s->base_addr, USER_HEAP_SIZE );
32     return TRUE;
33 }
34 #endif
35
36 /**********************************************************************
37  *                                      USER_InitApp
38  *
39  * Load necessary resources?
40  */
41 int
42 USER_InitApp(int hInstance)
43 {
44     int queueSize;
45
46     SpyInit();
47
48 #ifndef WINELIB    
49       /* Create USER heap */
50     if (!USER_HeapInit()) return 0;
51 #endif
52     
53       /* Global atom table initialisation */
54     if (!ATOM_Init()) return 0;
55     
56       /* GDI initialisation */
57     if (!GDI_Init()) return 0;
58
59       /* Initialize system colors and metrics*/
60     SYSMETRICS_Init();
61     SYSCOLOR_Init();
62
63       /* Create the DCEs */
64     DCE_Init();
65     
66       /* Initialize built-in window classes */
67     if (!WIDGETS_Init()) return 0;
68
69       /* Initialize dialog manager */
70     if (!DIALOG_Init()) return 0;
71
72       /* Create system message queue */
73     queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
74     if (!MSG_CreateSysMsgQueue( queueSize )) return 0;
75
76       /* Create task message queue */
77     queueSize = GetProfileInt( "windows", "DefaultQueueSize", 8 );
78     if (!SetMessageQueue( queueSize )) return 0;
79
80       /* Create desktop window */
81     if (!WIN_CreateDesktopWindow()) return 0;
82
83 #if 1
84 #ifndef WINELIB
85     /* Initialize DLLs */
86     InitializeLoadedDLLs();
87 #endif
88 #endif
89         
90     return 1;
91 }