Solved

running a app with no window or console in the background

Posted on 2008-10-20
8
1,199 Views
Last Modified: 2009-08-17
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.
0
Comment
Question by:gustierng
  • 5
  • 3
8 Comments
 
LVL 6

Expert Comment

by:RishadanPort
ID: 22759517
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
0
 

Author Comment

by:gustierng
ID: 22759538
what kind of application would you start with?
0
 

Author Comment

by:gustierng
ID: 22759742
Hi

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

thanks
0
 
LVL 6

Expert Comment

by:RishadanPort
ID: 22760291
>>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
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 6

Accepted Solution

by:
RishadanPort earned 500 total points
ID: 22760351

namespace NoWindowOrConsoleApplication

{

    static class Program

    {

        static void Main()

        { 

           //Write code in here

           //Normally when you want an application to show a windows

           //Form you use this: Application.Run(new ProgramForm());

           //Where "ProgramForm" is the main form used in the C#

           //application

        }

    }

}

Open in new window

0
 

Author Comment

by:gustierng
ID: 22764993
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.
0
 

Author Comment

by:gustierng
ID: 22765092
When I run the code above, it just runs and exits immediately.
0
 

Author Comment

by:gustierng
ID: 22766164
ok, using Application.Run() keeps it open
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Using MS Code on my Mac 6 45
visual Basic Net vs c# net 8 56
Hide Tab Page 3 19
cs.Designer Issue(2) 2 21
Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now