Release 940815
[wine/gsoc-2012-control.git] / misc / user.c
blob609e5ec700cdbc7bc3506ea8b50bcec149ce6058
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 MENU_Init();
21 extern BOOL WIN_CreateDesktopWindow();
23 #ifndef WINELIB
24 /***********************************************************************
25 * USER_HeapInit
27 static BOOL USER_HeapInit()
29 struct segment_descriptor_s * s;
30 s = GetNextSegment( 0, 0x10000 );
31 if (s == NULL) return FALSE;
32 HEAP_Init( &USER_Heap, s->base_addr, USER_HEAP_SIZE );
33 return TRUE;
35 #endif
37 /**********************************************************************
38 * USER_InitApp
40 * Load necessary resources?
42 int
43 USER_InitApp(int hInstance)
45 int queueSize;
47 SpyInit();
49 #ifndef WINELIB
50 /* Create USER heap */
51 if (!USER_HeapInit()) return 0;
52 #endif
54 /* Global atom table initialisation */
55 if (!ATOM_Init()) return 0;
57 /* GDI initialisation */
58 if (!GDI_Init()) return 0;
60 /* Initialize system colors and metrics*/
61 SYSMETRICS_Init();
62 SYSCOLOR_Init();
64 /* Create the DCEs */
65 DCE_Init();
67 /* Initialize built-in window classes */
68 if (!WIDGETS_Init()) return 0;
70 /* Initialize dialog manager */
71 if (!DIALOG_Init()) return 0;
73 /* Initialize menus */
74 if (!MENU_Init()) return 0;
76 /* Create system message queue */
77 queueSize = GetProfileInt( "windows", "TypeAhead", 120 );
78 if (!MSG_CreateSysMsgQueue( queueSize )) return 0;
80 /* Create task message queue */
81 queueSize = GetProfileInt( "windows", "DefaultQueueSize", 8 );
82 if (!SetMessageQueue( queueSize )) return 0;
84 /* Create desktop window */
85 if (!WIN_CreateDesktopWindow()) return 0;
87 #ifndef WINELIB
88 /* Initialize DLLs */
89 InitializeLoadedDLLs(NULL);
90 #endif
92 return 1;