How to create an .exe without execute the terminal in Windows?

Adam D Ruppe destructionator at gmail.com
Sat Aug 12 23:18:16 UTC 2023


On Saturday, 12 August 2023 at 23:13:39 UTC, thePengüin wrote:
>     I would know how to make some this but in Dlang:

best way is to use the linker switch.

On Win32, you can pass -L/subsystem:windows if you don't want a 
console to be automatically allocated.

Please note when compiling on Win64, you need to explicitly list 
-Lgdi32.lib -Luser32.lib on the build command. If you want the 
Windows subsystem too, use -L/subsystem:windows 
-L/entry:mainCRTStartup.

If using ldc instead of dmd, use -L/entry:wmainCRTStartup instead 
of mainCRTStartup; note the "w".

````
import core.sys.windows.windows;
      void hideConsoleWindow() {
      	ShowWindow(GetConsoleWindow(),SW_HIDE);
      	
      }
```

woudl also work.



More information about the Digitalmars-d-learn mailing list