CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    How to determine Process termination??

    Hi,

    How can we know if the Process has terminated ( if created using CreateProcess OR WinExec() functions ).

    Thanks,




  2. #2
    Join Date
    May 1999
    Posts
    68

    Re: How to determine Process termination??

    Hi,

    if you use create CreateProcess :
    You can use a structure of type PROCESS_INFORMATION

    if (pi.hProcess)
    {
    DWORD dwExitCode = STILL_ACTIVE;
    while (dwExitCode == STILL_ACTIVE)
    {
    WaitForSingleObject(pi.hProcess, 1000);
    GetExitCodeProcess(pi.hProcess, &dwExitCode);
    }
    }
    This while statement will wait and loop untill you process is done.

    -- Ron




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured