Release 940804
[wine/gsoc-2012-control.git] / misc / user.c
blobcce820e0c8afe7d80b847c12c3768de79cfbfa45
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();
20 extern BOOL WIN_CreateDesktopWindow();
22 #ifndef WINELIB
23 /***********************************************************************
24 * USER_HeapInit
26 static BOOL USER_HeapInit()
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;
34 #endif
36 /**********************************************************************
37 * USER_InitApp
39 * Load necessary resources?
41 int
42 USER_InitApp(int hInstance)
44 int queueSize;
46 SpyInit();
48 #ifndef WINELIB
49 /* Create USER heap */
50 if (!USER_HeapInit()) return 0;
51 #endif
53 /* Global atom table initialisation */
54 if (!ATOM_Init()) return 0;
56 /* GDI initialisation */
57 if (!GDI_Init()) return 0;
59 /* Initialize system colors and metrics*/
60 SYSMETRICS_Init();
61 SYSCOLOR_Init();
63 /* Create the DCEs */
64 DCE_Init();
66 /* Initialize built-in window classes */
67 if (!WIDGETS_Init()) return 0;
69 /* Initialize dialog manager */
70 if (!DIALOG_Init()) return 0;
72 /* Create system message queue */
73 queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
74 if (!MSG_CreateSysMsgQueue( queueSize )) return 0;
76 /* Create task message queue */
77 queueSize = GetProfileInt( "windows", "DefaultQueueSize", 8 );
78 if (!SetMessageQueue( queueSize )) return 0;
80 /* Create desktop window */
81 if (!WIN_CreateDesktopWindow()) return 0;
83 #ifndef WINELIB
84 /* Initialize DLLs */
85 InitializeLoadedDLLs(NULL);
86 #endif
88 return 1;