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