Release 940301
[wine/gsoc-2012-control.git] / misc / user.c
blob51b94afc241b842bb86b267feb0b0dc8b38d72f8
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";
4 #include <stdio.h>
5 #include <stdlib.h>
6 #include "prototypes.h"
7 #include "windows.h"
8 #include "user.h"
9 #include "message.h"
11 #define USER_HEAP_SIZE 0x10000
14 MDESC *USER_Heap = NULL;
17 extern BOOL ATOM_Init();
18 extern BOOL GDI_Init();
19 extern void SYSMETRICS_Init();
21 #ifndef WINELIB
22 /***********************************************************************
23 * USER_HeapInit
25 static BOOL USER_HeapInit()
27 struct segment_descriptor_s * s;
28 s = GetNextSegment( 0, 0x10000 );
29 if (s == NULL) return FALSE;
30 HEAP_Init( &USER_Heap, s->base_addr, USER_HEAP_SIZE );
31 return TRUE;
33 #endif
35 /**********************************************************************
36 * USER_InitApp
38 * Load necessary resources?
40 int
41 USER_InitApp(int hInstance)
43 int queueSize;
45 SpyInit();
47 /* Global atom table initialisation */
48 if (!ATOM_Init()) return 0;
50 /* GDI initialisation */
51 if (!GDI_Init()) return 0;
53 /* Initialize system colors and metrics*/
54 SYSMETRICS_Init();
55 SYSCOLOR_Init();
57 #ifndef WINELIB
58 /* Create USER heap */
59 if (!USER_HeapInit()) return 0;
60 #endif
62 /* Create the DCEs */
63 DCE_Init();
65 /* Initialize built-in window classes */
66 if (!WIDGETS_Init()) return 0;
68 /* Initialize dialog manager */
69 if (!DIALOG_Init()) return 0;
71 /* Create system message queue */
72 queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
73 if (!MSG_CreateSysMsgQueue( queueSize )) return 0;
75 /* Create task message queue */
76 queueSize = GetProfileInt( "windows", "DefaultQueueSize", 8 );
77 if (!SetMessageQueue( queueSize )) return 0;
79 #ifndef WINELIB
80 /* Initialize DLLs */
81 InitializeLoadedDLLs();
82 #endif
84 return 1;