Release 950319
[wine.git] / toolkit / winmain.c
bloba5718ca8290d7eae8f634b89d778a49ccb0416cd
1 #include <stdio.h>
2 #include <string.h>
3 #include <malloc.h>
4 #include "windows.h"
5 #include "wine.h"
7 extern HINSTANCE hSysRes;
9 _WinMain (int argc, char *argv [])
11 int ret_val;
12 char filename [4096], *module_name, *resource_file;
13 HANDLE hTaskMain, hInstance;
15 GetPrivateProfileString("wine", "SystemResources", "sysres.dll",
16 filename, sizeof(filename), WINE_INI);
17 hSysRes = LoadImage(filename);
18 if (hSysRes == (HINSTANCE)NULL)
19 printf("Error Loading System Resources !!!\n");
20 else
21 printf("System Resources Loaded // hSysRes='%04X'\n", hSysRes);
23 if ((module_name = strchr (argv [0], '/')) == NULL){
24 printf ("Error: Can't determine base name for resource loading\n");
25 return 0;
28 resource_file = malloc (strlen (++module_name) + 5);
29 strcpy (resource_file, module_name);
30 strcat (resource_file, ".dll");
32 hInstance = LoadImage (resource_file, 0, 0);
34 USER_InitApp (hSysRes);
35 hTaskMain = CreateNewTask (1); /* This is not correct */
36 ret_val = WinMain (hInstance, /* hInstance */
37 0, /* hPrevInstance */
38 "", /* lpszCmdParam */
39 SW_NORMAL); /* nCmdShow */
40 return ret_val;