int WINAPI WinMain()

in src/main/cpp/launcher/windows/src/Main.c [625:659]


int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE hi, LPSTR lpCmdLine, int nCmdShow) {
    DWORD exitCode = 1;
    DWORD status = ERROR_OK;
    
    totalProgressSize = newint64_t(0,0);
    currentProgressSize = newint64_t(0,0);
    globalInstance = hInstance;
    UNREFERENCED_PARAMETER(lpCmdLine);
    initWow64();
    if(is9x()) {
        MessageBoxA(0, "Windows 9X platform is not supported", "Message", MB_OK);
        status = EXIT_CODE_SYSTEM_ERROR;
    } else {
        if(!createEvents()) {
            status = EXIT_CODE_EVENTS_INITIALIZATION_ERROR;
        } else {
            LauncherProperties * props = createLauncherProperties();
            createLauncherThread(props);
            if(!createGui(props, hInstance, hi, nCmdShow)) {
                status = EXIT_CODE_GUI_INITIALIZATION_ERROR;	        
            } else {	        
                messageLoop(props);
                WaitForSingleObject(closingWindowsConfirmed, INFINITE);
            }
            
            status = props->status;
            exitCode = props->exitCode;
            printStatus(props);
            freeLauncherProperties(&props);
        }
    }
    FREE(currentProgressSize);
    FREE(totalProgressSize);
    return (status==ERROR_OK) ? exitCode : status;
}