My small loader is not so small anymore. I've modified it according to the sample but the console is still showing:
import core.runtime; import std.c.windows.windows; import std.process: system; extern (Windows) int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { int result; void exceptionHandler(Throwable e) { throw e; } try { Runtime.initialize(&exceptionHandler); result = system(r"bin\someprogram.exe"); Runtime.terminate(&exceptionHandler); } catch (Object o) // catch any uncaught exceptions { MessageBoxA(null, cast(char*)o.toString(), "Error", MB_OK | MB_ICONEXCLAMATION); result = 0; // failed } return result; } NOTE: The sample on the website doesn't compile because exceptionHandler() should receive a Throwable not an Exception. I then added a loader.def file that looks like this: EXETYPE NT SUBSYSTEM WINDOWS And to compile I'm using this line: dmd loader.d loader.def resource.res The console is still showing. Any ideas why? Thanks