2 * Emulator initialisation code
7 #include "wine/winbase16.h"
15 #include "debugtools.h"
17 /***********************************************************************
18 * Main loop of initial task
20 void wine_initial_task(void)
26 if (!LoadLibraryA( "user32.dll" ))
28 MESSAGE( "Cannot load user32.dll\n" );
29 ExitProcess( GetLastError() );
33 GetStartupInfoA( &info );
34 if (!(info.dwFlags & STARTF_USESHOWWINDOW)) info.wShowWindow = SW_SHOWNORMAL;
36 if ((instance = WinExec16( GetCommandLineA(), info.wShowWindow )) < 32)
38 if (instance == 11) /* try DOS format */
40 MZ_LoadImage( GetCommandLineA() );
41 /* if we get back here it failed */
42 instance = GetLastError();
45 MESSAGE( "%s: can't exec '%s': ", argv0, GetCommandLineA() );
48 case 2: MESSAGE("file not found\n" ); break;
49 case 11: MESSAGE("invalid exe file\n" ); break;
50 default: MESSAGE("error=%d\n", instance ); break;
52 ExitProcess(instance);
55 /* Start message loop for desktop window */
57 while ( GetNumTasks16() > 1 && Callout.GetMessageA( &msg, 0, 0, 0 ) )
59 Callout.TranslateMessage( &msg );
60 Callout.DispatchMessageA( &msg );
67 /**********************************************************************
70 int main( int argc, char *argv[] )
72 PROCESS_InitWine( argc, argv );
73 return 1; /* not reached */