none
How to remove .exe file from task manager - processes

    Question

  • Hi Friends,

    Currently I am working with C# windows application and when I close the application, it is closing but it is still in windows task manager - processes.

    when i open second time it is not working.

    Please can any body help me regarding this one. i mean when i close the application, it should be close from processes.

    thanks

    Babu

    Thursday, March 22, 2007 3:38 AM

Answers

  • The generic explanation is that the program is closing its windows but is still running code afterwards.  DoEvents() can do this, a foreground thread that doesn't stop can do that too.  One way to find out is to run the program in a debugger and use Debug + Break after the program closed its windows but is not exiting.
    Thursday, March 22, 2007 3:56 PM

All replies

  • Are you using DoEvents()?  Set a breakpoint on the closing curly brace of the Main() method in Process.cs to verify that your program actually exits or just closes the main form.
    Thursday, March 22, 2007 6:25 AM
  • Thanks for your reply.

    My  question is whenever i close a running(Windows) application and if  i move to the Windows Task Manager, sometimes the processes gets close, some other times the processes still running in the Task Manager. Can you give me solution on this,whenever i close the application it could also get closed in the Task Manager?

    Thanks

    Babu.

     

     

     

    Thursday, March 22, 2007 8:44 AM
  • It is a bug in the C# program.  Did you write this program?
    Thursday, March 22, 2007 8:53 AM
  •  

    Actually its a big application. It has coded a year  back. And i am into enhancements. I cant rewrite the code, becoz it will affect the entire application.

     

    Can you explain me the bug whether it will be of serious effect or slightly normal one. and give me the bug scenario where it will occur. Then it will be helpful for me to detect and i will  try to change the code..

    Thanks

    Babu.

    Thursday, March 22, 2007 11:39 AM
  • The generic explanation is that the program is closing its windows but is still running code afterwards.  DoEvents() can do this, a foreground thread that doesn't stop can do that too.  One way to find out is to run the program in a debugger and use Debug + Break after the program closed its windows but is not exiting.
    Thursday, March 22, 2007 3:56 PM
  • Hello Sridhar Babu,

    put this to your FormClose or FormClosing Event of your main form

    Application.Exit();

     

    Hope this will help.

    Larrix


    Larrix
    Monday, August 08, 2011 8:26 AM