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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T17:26:43+00:00 2026-05-13T17:26:43+00:00

CreateProcess() came up a few times searching google…. Is it OK to assume this

  • 0

CreateProcess() came up a few times searching google….
Is it OK to assume this is the safest and most efficient method?
If so, I would like to use the output of the called process.
How do I know it has completed before continuing on in the C program?

Thanks.

  • 1 1 Answer
  • 1 View
  • 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-13T17:26:43+00:00Added an answer on May 13, 2026 at 5:26 pm

    ShellExecute Can be used to create a process, its a more convenient way to pass arguments.

    But if you want to use the output of the process then CreateProcess is probably your best bet

    With CreateProcess you can pass a STARTUPINFO structure that can be used to pass a file pipe handle to Standard Out of the process.

    CreateProcess will return a PROCESS_INFORMATION structure containing a HANDLE to the created process. That handle will become signalled when the process exits.

    So You can WaitForSingleObject on the process handle to wait for the output to be complete.

    Don’t forget to CloseHandle on the process handle and thread handle when you are done.

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

Sidebar

Related Questions

if I am using CreateProcess() multiple times, is okay to share the PROCESS_INFORMATION and
Functions such as CreateProcess have signatures taking pointers to structs. In C I would
I have created a process using CreateProcess() . This is the code: STARTUPINFO si
Can I add breakpoint on windows CreateProcess API in Visual studio like I can
I am trying to set security of PROCESS_TERMINATE. This is the code: CreateProcess(C:\\ADP\\SQLBase\\dbntsrv.exe, NULL,
I have never seen this notation.... CreateProcess (Lc:\s2.exe, NULL, NULL, NULL, false, 0, NULL,
I create a child with CreateProcess and wait for it to finish. This process
I have a simple win32 application that uses the createProcess method to call Qt
I tried using CreateProcess to run a simple command like hg > test.txt .
My application uses some APIs like GetProcAddress and CreateProcess that cause sometimes antiviruses to

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.