I do not know how to prevent the console window from being displayed. The best approach in a console application is to hide the window immediately after loading the application. The visual effect is a quick opening of the console window, after which it disappears. Perhaps this is not optimal.
A better approach might be to use Winexe instead of a console application. Inside a Windows application (possibly a winforms application), never create an instance of the first form. Therefore, nothing is displayed.
This prevents user interaction, but from your description, it looks like what you want.
But I'm not sure that you have control over the "console application".
source share