win32_utf8 icon indicating copy to clipboard operation
win32_utf8 copied to clipboard

Question regarding "entry_*.c": App with Console and GUI modes

Open Amaroq-Clearwater opened this issue 4 years ago • 2 comments

If I'm trying to make a program that can execute both in console and in a GUI, like if I use a command-line argument in the shortcut "-console" that launches a console alongside the GUI version, or "-nogui" which disables the GUI and automatically launches the console, which entry file am I supposed to use?

Amaroq-Clearwater avatar Apr 27 '20 14:04 Amaroq-Clearwater

When you make a program like that, you usually start without a console, then create one with AllocConsole. Because you start without a console, you will use entry_winmain.c .

brliron avatar Apr 27 '20 15:04 brliron

And if you want to use things like printf you also need to do

freopen("CONIN$", "r", stdin); 
freopen("CONOUT$", "w", stdout); 
freopen("CONOUT$", "w", stderr); 

32th-System avatar Apr 27 '20 15:04 32th-System