Release 960225
[wine.git] / library / winmain.c
blobb94554eadb2ab4671f63cd7aee34d4c4b7278651
1 #include <stdio.h>
2 #include <string.h>
3 #include <malloc.h>
4 #include "windows.h"
5 #include "wine.h"
7 extern int MAIN_Init(void);
8 extern BOOL WIDGETS_Init(void);
9 extern BOOL WIN_CreateDesktopWindow(void);
10 extern int PASCAL WinMain(HINSTANCE,HINSTANCE,LPSTR,int);
11 extern void TASK_Reschedule(void);
12 extern int USER_InitApp(HINSTANCE);
15 int _WinMain (int argc, char *argv [])
17 HINSTANCE hInstance;
19 if(!MAIN_Init()) return 0; /* JBP: Needed for DosDrives[] structure, etc. */
20 hInstance = WinExec( *argv, SW_SHOWNORMAL );
21 TASK_Reschedule();
22 USER_InitApp( hInstance );
23 /* Perform global initialisations that need a task context */
24 if (!WIDGETS_Init()) return -1;
25 if (!WIN_CreateDesktopWindow()) return -1;
27 #ifdef WINELIBDLL
28 return (int)hInstance;
29 #else
30 return WinMain (hInstance, /* hInstance */
31 0, /* hPrevInstance */
32 "", /* lpszCmdParam */
33 SW_NORMAL); /* nCmdShow */
34 #endif