8 extern int MAIN_Init(void);
9 extern BOOL
WIDGETS_Init(void);
10 extern BOOL
WIN_CreateDesktopWindow(void);
11 extern int WinMain(HINSTANCE
,HINSTANCE
,LPSTR
,int);
12 extern void TASK_Reschedule(void);
13 extern int USER_InitApp(HINSTANCE
);
16 int _WinMain (int argc
, char *argv
[])
22 /* Alloc szCmdParam */
23 for (i
= 1; i
< argc
; i
++) len
+= strlen(argv
[i
]) + 1;
24 lpszCmdParam
= (LPSTR
) xmalloc(len
+ 1);
25 /* Concatenate arguments */
26 if (argc
> 1) strcpy(lpszCmdParam
, argv
[1]);
27 else lpszCmdParam
[0] = '\0';
28 for (i
= 2; i
< argc
; i
++) strcat(strcat(lpszCmdParam
, " "), argv
[i
]);
30 if(!MAIN_Init()) return 0; /* JBP: Needed for DosDrives[] structure, etc. */
31 hInstance
= WinExec( *argv
, SW_SHOWNORMAL
);
33 USER_InitApp( hInstance
);
34 /* Perform global initialisations that need a task context */
35 if (!WIDGETS_Init()) return -1;
36 if (!WIN_CreateDesktopWindow()) return -1;
39 return (int)hInstance
;
41 return WinMain (hInstance
, /* hInstance */
42 0, /* hPrevInstance */
43 lpszCmdParam
, /* lpszCmdParam */
44 SW_NORMAL
); /* nCmdShow */