Console Application With No Window

Hi everyone,
I am building a console helper application on Windows that will be used on demand, that is run, do some stuff and then quit.
How can I avoid the console window to appear while it starts/runs since I don’t want it to show over the application’s window?
Appearing minimized should be Ok as well, but I would prefer for it to not show at all.

A ConsoleApplication is to be run from the console, hence its name. For an application which doesn’t start from the console look at ServiceApplication.

But since you say [quote=176268:@FOTIS GEORGIADIS] that will be used on demand[/quote] you most probably need a console application.

This seems to imply that you are launching the helper app from your main app. If so, run it in a Shell instead of launching it. Shells run in the background with no UI.

Thanks Eli, for your replay. I don’t want the helper app to register as a service.

Thanks Tim, that is exactly what I need!

Another question.
In this console app I am managing some serial communications. Now these are asynchronous (there is no other choice anyway, right?), so how can I keep the app alive while waiting for the data from the serial port?

There is an alternative : a windowless desktop app. It will spare the need to use a shell to run yet another, console app, and it will remain alive as long as it is not terminated. To prevent the app from showing in the Taskbar ( a bit like a service app), I created a declare a while ago. See https://forum.xojo.com/13817-creating-an-application-with-no-taskbar-icon

Thank you Michel. I have been using a windowless desktop app (sort of a coupled daemon app) for some time now. I just removed the Default Window and Menubar from the App properties and that did it!
Is there something wrong with this approach?

[quote=176287:@FOTIS GEORGIADIS]Thank you Michel. I have been using a windowless desktop app (sort of a coupled daemon app) for some time now. I just removed the Default Window and Menubar from the App properties and that did it!
Is there something wrong with this approach?[/quote]

I do not think so. I use it myself and even found out that a desktop app can be run as a service. I suspect a Web app could as well. The major problem of a windowless desktop is that it cannot dialog though StdIn and StdOut like a Console app would. It may require a bit more memory, too, but on current machines that probably does not count.

Under Linux, though, it makes a lot of difference : not all Linux installations have X11, so desktop apps may not run on, for instance, a server, whereas a console one would.

The device this helper app is going to communicate will be done on Windows only. So there is no problem there…