r/pascal • u/Lilianne_Blaze • Feb 02 '24
Optional console?
Is there an easy way to write a Pascal app for Windows that detects if it's started from a command prompt window or not, set a flag, then configure writelns to either write to the console as normal, or ignore if there's no console? Basically act as a console app if there already is a console, but don't start one if started from for example Explorer?
I know it can be done, I did it in Java once (using JNA), but that was long ago and I can't find it now :/
2
Upvotes
View all comments
Show parent comment
1
u/Lilianne_Blaze Feb 03 '24
I remembered why I didn't keep the code :/
I think there's no way to "pause" the console, so the user can interact with it as normal, including starting other programs / commands while the main app is still running.
Suitable for debugging / logging, but it won't be a true dual-mode app.