Answer the question
In order to leave comments, you need to log in
How to understand if the process has completed?
Hello,
I have a program that consists of 2 exe files, I wrote both.
Both exe files are in the same directory.
1 exe file under certain conditions launches the 2nd exe file.
After running the 2nd exe file, the first one ends. 2 must wait for the first to complete and only after that start doing something.
The problem is that my program is in the user's home directory, there can be several users on the computer, the investigator can run several instances of 1 and 2 exe files.
How can I write in the second exe file so that it looks for the process that launched it?
I know for sure what the path of the 1st exe file is, is it possible to somehow find the process along its path?
Thank you very much in advance!
Answer the question
In order to leave comments, you need to log in
Pass the id of the first process as a parameter when starting the second one. Then the second one will be able to find the parent process by this id and wait until it ends.
Searching for a process by name will definitely help you.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question