Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 337837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T10:22:23+00:00 2026-05-12T10:22:23+00:00

My understanding is that when you kill a C++ application through Task Manager in

  • 0

My understanding is that when you kill a C++ application through Task Manager in Windows XP, the application is still “cleanly” destructed – i.e. the call stack will unwind and all the relevant object destructors will be invoked. Not sure if my understanding is wrong here.

Is it possible to kill such an application immediately, without unwinding the stack?

For example, the application may employ RAII patterns which will destroy or release resources when an object is destructed. If the traditional “kill process” through Task Manager is graceful, providing a way to kill the application immediately would allow me to test ungraceful shutdown (e.g. a power outage).

Edit:

Just to clarify, I was after an existing utility or program that would allow me to do this. I should be able to use the solution on programs that I don’t have the source code for, meaning that a programmatic solution is not really acceptable.

Edit:

Just to provide more context, sometimes I have to work with 3rd party services which are very intrusive (e.g. nagging me to reboot every hour). Since I know that I don’t need to reboot, I want to kill the process/service so it doesn’t nag me anymore. Unfortunately some of the 3rd party developers were “smart” enough to prevent me from doing this, and when I kill the process through Task Manager, the system will reboot immediately (I’m guessing that are using RAII to achieve this).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T10:22:23+00:00Added an answer on May 12, 2026 at 10:22 am

    I believe task manager tries a “nice” shutdown by sending a WM_CLOSE message, then if the application doesn’t respond it’s killed.

    This call should kill the process immediately with no warning:

    TerminateProcess

    e.g.:

    TerminateProcess(GetCurrentProcess(), 1);
    

    Update:

    You may find this article interesting:

    Quitting time: exiting a C++ program

    Update 2:

    I should be able to use the solution on programs that I don’t have the source code for

    Hmm, well this is undesirable behavior 99.9% of the time.

    SysInternals has a utility called pskill:

    http://technet.microsoft.com/en-us/sysinternals/bb896683.aspx

    but I’m not sure how “nice” it is.

    You might need to roll your own, but it should be pretty easy:

    DWORD pid = <get pid from command line>;
    
    TerminateProcess(OpenProcess(PROCESS_TERMINATE, FALSE, pid));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 216k
  • Answers 216k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Assuming that your ul has an id of theList, the… May 12, 2026 at 11:15 pm
  • Editorial Team
    Editorial Team added an answer operator<< : std::cout is an std::ostream object, so you have… May 12, 2026 at 11:15 pm
  • Editorial Team
    Editorial Team added an answer The operator "?" is named ternary operator. It is used… May 12, 2026 at 11:15 pm

Related Questions

My understanding is that when you have a view that's too small to easily
Like every other web developer on the planet, I have an issue with users
So, I have a webapp with a fair amount of JSPs, servlets, alot of
What is the series of steps needed to securely verify a ssl certificate? My

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.