473,499 Members | 1,774 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Process continues to run after Application.Exit()

When the user clicks on my Exit menu command I call Close() followed by
Application.Exit(). The GUI goes away as expected but the process is
still listed in Task Manager. What do I need to do to really terminate
the process?

May 11 '06 #1
2 5874
"cweeks" <cw*********@yahoo.com> wrote:
When the user clicks on my Exit menu command I call Close() followed by
Application.Exit(). The GUI goes away as expected but the process is
still listed in Task Manager. What do I need to do to really terminate
the process?


If you have a thread somewhere that hasn't exited, the process will
still continue to run. Application.Exit posts an exit message to all
thread message pumps, causing windows to close. You should try to find
out what's running by breaking into the program with the debugger.

To force a harder exit, you can call Environment.Exit.

-- Barry
May 11 '06 #2
Hello cweeks,

This behavior is due to worker thread, when you close the app worker thread
continue working till finish his own task.
To prevent this, set your tread to backgroud mode (IsBackground property)
- this thead will be closed with the application

c> When the user clicks on my Exit menu command I call Close() followed
c> by Application.Exit(). The GUI goes away as expected but the process
c> is still listed in Task Manager. What do I need to do to really
c> terminate the process?
c>
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour

"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
May 11 '06 #3

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

Similar topics

3
5933
by: Jesper Denmark | last post by:
Hi, After a given exception I would like to terminate the program. I've been told that Application.Exit() should do the trick, but I cant seem to make it work at all. It compiles fine. But it...
1
17643
by: Brendan Miller | last post by:
I am trying to close my application using Application.exit() in the frmMain_Closing event. When the form closes the process does not. My application only has one form (no other classes either). ...
6
20035
by: orekin | last post by:
Hi There I have been trying to come to grips with Application.Run(), Application.Exit() and the Message Pump and I would really appreciate some feedback on the following questions .. There are...
22
2176
by: Shelby | last post by:
Hi, I used System.Windows.Forms.Application.DoEvents() in a loop to handle user click close button . Private Sub btnclose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)...
3
1514
by: Mike Johnson | last post by:
I have the following code in form1 and when the application starts this sub is called to check for a path if not found a message box is displayed and then gives the user an option to end the...
3
1656
by: marciocamurati | last post by:
Hi, I have a problem with my application exit, I create a button that call another form and close my application: Private Sub closeApplication() Dim Status As New Status status.Show() ...
4
1939
by: Chip | last post by:
Can somebody explain to me why my process continues to run after I halt execution? This plays havoc with debugging. I expect to be starting a new instance at the beginning of a loop and the first...
4
1491
by: J Ames | last post by:
I have a VB.NET 2005 app I'm developing. I've created a mail class library and I'm making a reference to it in my code. All of that works fine. The object is called when a certain condition is...
1
5079
by: =?Utf-8?B?VGFvZ2U=?= | last post by:
Hi All, When I use applcation.exit() in winForm application, the form closed, but the process is still going!! ( The debug process is still running if debug in VS IDE). Environment.Exit(0) works...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7174
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
7220
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...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
297
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.