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 8821793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T05:56:30+00:00 2026-06-14T05:56:30+00:00

In MFC, I am using this code ShellExecute(NULL, _T(open), _T(EXTERNAL_APP), params, _T(EXTERNAL_PATH), SW_HIDE); to

  • 0

In MFC, I am using this code

ShellExecute(NULL, _T("open"), _T(EXTERNAL_APP), params, 
             _T(EXTERNAL_PATH), SW_HIDE);

to start an external program which runs in the background.

However when my app is terminated , this program is still running, as can be verified by inspecting the Windows Task Manager pane.

So my question is, how can I make the external program stop when my app stops ?

  • 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-06-14T05:56:31+00:00Added an answer on June 14, 2026 at 5:56 am

    Try ShellExecuteEx instead, which can return a HANDLE hProcess of the newly-started process.

    When/if you have a HANDLE hProcess then I expect you can pass it as a parameter it to the TerminateProcess function: which you would call (to terminate the child process) before your application stops.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using this code from NEHE tutorial in my MFC based application on
I'm using vc2008, writing some MFC code, I add a button, double click it,
I have C++ application which has UI developed using MFC, does some networking using
I am writing a MFC program in which I have a a lot of
So I have this MFC dialog program I am working with. The dialogs are
Sample code that shows how to create threads using MFC declares the thread function
I am creating a MFC program using the document/view architecture. In the view I
in a C++ MFC application. using the dc of ( CPaintDC dc(this); ) How
I have this MFC app with the following piece of code to check for
I am using MFC CFile Seek function. I have a problem about Seek out

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.