Link to home
Start Free TrialLog in
Avatar of gustierng
gustierng

asked on

running a app with no window or console in the background

Is there an elegant way of running a background process without having a console or window?

i.e. not having something like a while true in main

Something tailor made for this perhaps, but not a windows service.
Avatar of RishadanPort
RishadanPort

One way, is simply create a C# method, goto the program.cs file, and remove the "Application.Run()" function, and in this function (the main method), add whatever you like
Avatar of gustierng

ASKER

what kind of application would you start with?
Hi

I have tried to see what you have suggested but do not understand.  Please clarify.

thanks
>>Is there an elegant way of running a background process without having a console or window?
Why exactly are you trying to make a process that is not visible in a window or console? The only reason that I see is to make a process that is malicious. Could you clarify what you are trying to achieve with this process?

>>i.e. not having something like a while true in main
You could simply use threads which wait until they have a job to do
ASKER CERTIFIED SOLUTION
Avatar of RishadanPort
RishadanPort

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The purpose is to make a .net remoting app on a localhost with services on different processes.  Therefore no need for a console or window.  Also other platforms such as unix allow you to run programs easily in the background without the annoyance of a command window.  So, have been looking or a way to do this.
When I run the code above, it just runs and exits immediately.
ok, using Application.Run() keeps it open