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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:01:01+00:00 2026-05-28T01:01:01+00:00

I am creating a child process with creatprocess api.And i created a jobobject and

  • 0

I am creating a child process with creatprocess api.And i created a jobobject and assigned this child process to jobobject.
Now, if i kill my parent process, child process terminates too.But if i suspend parent process, child process doesn’t suspend and continue execution.
is there any option to suspend child process, when parent process is suspended?

Delphi Code which i have used for creating a process

Function ExecuteProcess(EXE : String) : THandle;

Var
SI      : TStartupInfo;
PI      : TProcessInformation;
Begin
  Result := INVALID_HANDLE_VALUE;
  FillChar(SI,SizeOf(SI),0);
  SI.cb := SizeOf(SI);
  If 
    CreateProcess(nil,PChar('.\'+EXE),nil,nil,False,CREATE_SUSPENDED,
     nil,nil,SI,PI) Then 
   Begin
    ResumeThread(PI.hThread);
    CloseHandle(PI.hThread);
    Result := PI.hProcess;
   End
  Else ShowMessage('CreateProcess failed: '+
                   SysErrorMessage(GetLastError));
End;
  • 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-28T01:01:01+00:00Added an answer on May 28, 2026 at 1:01 am

    From the Windows API perspective, there’s no such thing as suspending a process. Only threads can be suspended, but there are no parent-child relationships between threads. Since there are no “child threads,” there is no automatic mechanism for suspending them when the parent is suspended. (You can create a process suspended, but that’s because when it’s first created, there’s only one thread, and it is created suspended.)

    If you want to suspend all the threads of the child process, then enumerate them and suspend them the same way you suspend the threads of the parent process.

    You might also try the undocumented NtSuspendProcess function, as mentioned in Windows: Atomically suspend an entire process?

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

Sidebar

Related Questions

When creating a child process in C++ using Windows API, one can allow inheritance
I'm creating child processes with fork() in C/C++. When the parent process ends (or
After creating a child process and exiting it immediately (_exit()), I want to perform
My Windows XP/7 program launches a child process using the Windows API CreateProcess() function
I'm creating child processes in a for -loop. Inside the child process, I can
Microsoft played safe here. In their article, Creating a Child Process with Redirected Input
I am making a server and I use fork() for creating child processes but
I'm creating new processes using System.Diagnostics.Process class from my application. I want this processes
I'm creating a global semaphore object in a process like this: CreateSemaphore(NULL, 1, 1,
I am creating a child-parent fork() to be able to communicate with a shell(

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.