473,387 Members | 1,903 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

console as background app...

hi,

i want to make the console application running at the background but not
as a service by hiding the console window...

can anyone help me on this?

Jake
Nov 13 '06 #1
4 5871
Do it as a windows app that doesnt have a form. As far as i know you can hide
the console as windows provides it. It will have to be a windows app where
you dont show a form in Main but do something else.

Ciaran O'Donnell

"Jake Yu" wrote:
hi,

i want to make the console application running at the background but not
as a service by hiding the console window...

can anyone help me on this?

Jake
Nov 13 '06 #2
Thanks for your reply...

There is a way to hide the console window by calling win32 functions,
GetConsoleWindow and ShowWindow. But it still shows the console window
before trying to hide by calling win32 apis.

Anyway, i created new windows app this time and created a thread to do
what i wanted to do at the background before calling Application.Run()
without passing Form to Run method. But when i finished work in the
thread, i don't know how to quit the app. In vc++, usually posting
WM_QUIT windows message terminates itself, but how do you achieve the
same thing in c#?

Jake

Ciaran O''Donnell wrote:
Do it as a windows app that doesnt have a form. As far as i know you can hide
the console as windows provides it. It will have to be a windows app where
you dont show a form in Main but do something else.

Ciaran O'Donnell

"Jake Yu" wrote:

>>hi,

i want to make the console application running at the background but not
as a service by hiding the console window...

can anyone help me on this?

Jake
Nov 13 '06 #3
Hi Jake,

1. Returning from the Main method will stop the process

2. Environment.Exit will stop the process

3. Application.Exit will close all Forms and stop all message loops.
Application.Run will then return control to the caller once the exit is
complete.

--
Dave Sexton

"Jake Yu" <ja***@fujitsu.fast.com.auwrote in message
news:uK**************@TK2MSFTNGP04.phx.gbl...
Thanks for your reply...

There is a way to hide the console window by calling win32 functions,
GetConsoleWindow and ShowWindow. But it still shows the console window
before trying to hide by calling win32 apis.

Anyway, i created new windows app this time and created a thread to do what
i wanted to do at the background before calling Application.Run() without
passing Form to Run method. But when i finished work in the thread, i don't
know how to quit the app. In vc++, usually posting WM_QUIT windows message
terminates itself, but how do you achieve the same thing in c#?

Jake

Ciaran O''Donnell wrote:
>Do it as a windows app that doesnt have a form. As far as i know you can
hide the console as windows provides it. It will have to be a windows app
where you dont show a form in Main but do something else.

Ciaran O'Donnell

"Jake Yu" wrote:

>>>hi,

i want to make the console application running at the background but not as
a service by hiding the console window...

can anyone help me on this?

Jake

Nov 13 '06 #4
You should call Application.Exit which will return you to the main methods
after the call to application.run().

Ciaran O'Donnell

"Jake Yu" wrote:
Thanks for your reply...

There is a way to hide the console window by calling win32 functions,
GetConsoleWindow and ShowWindow. But it still shows the console window
before trying to hide by calling win32 apis.

Anyway, i created new windows app this time and created a thread to do
what i wanted to do at the background before calling Application.Run()
without passing Form to Run method. But when i finished work in the
thread, i don't know how to quit the app. In vc++, usually posting
WM_QUIT windows message terminates itself, but how do you achieve the
same thing in c#?

Jake

Ciaran O''Donnell wrote:
Do it as a windows app that doesnt have a form. As far as i know you can hide
the console as windows provides it. It will have to be a windows app where
you dont show a form in Main but do something else.

Ciaran O'Donnell

"Jake Yu" wrote:

>hi,

i want to make the console application running at the background but not
as a service by hiding the console window...

can anyone help me on this?

Jake
Nov 13 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my...
2
by: Gulshan Oshan | last post by:
I want to implement a simple console that continuously listens for an event from a custom object. I am unable to capture the events from the object. If I subscribe to the events in a windows app...
5
by: Publicjoe | last post by:
I am working on a little app which uses colour in the console window. I have created a class to extend the console functionality but the ClearScreen method does not work correctly. I am enclosing a...
3
by: inpreet | last post by:
I am trying to build a console application in C#.Net. This application is suppose to run in background without user interaction. How can I hide console to appear?
6
by: Giojo | last post by:
Hello guys! I can't resolve this problem.. I want my programm in c# working with only console if there are some parameters, but if someone make double-click on the exe I want to start the graphic...
5
by: Tim Werth | last post by:
I have a .NET console application that is kicked off by a .NET Windows service. They communicate via .NET Remoting, although there isn't much communication between the two while the console app is...
6
by: Mythran | last post by:
Is it possible to attach Windows WndProc hooks into a Console application window? Thanks, Mythran
6
by: vijai.kalyan | last post by:
Hello, I wrote a trivial program to set the console title in a console application. Here is the code:- namespace myns { class SetTitle { static void Main ( string args )
12
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.