What are we talking about? Required:

  1. Launch the application with a * .exe file with parameters (parameters passed to main programs and application launch parameters (minimized window, windowless mode))
  2. The ability to learn that the process is still working and, the ability to terminate it (if it works and is no longer needed) and restart (completed by itself or with an error - start again)
  3. The ability to use these tools on Unix (for example, Debian 8), and on Windows.

It is possible and means boost.

I would also like to see an example of the use of the following type:

int _tmain(int argc, char* argv[]) { if (argc < 3) { bool state = true; //запускаСм копию этого прилоТСния с Π±ΠΎΠ»Π΅Π΅ Ρ‡Π΅ΠΌ 3 ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°ΠΌΠΈ int i = 1; while (state) { std::this_thread::sleep_for(std::chrono::seconds(1)); if (/*ΠΏΡ€ΠΈΠ»ΠΎΠΆΠ΅Π½ΠΈΠ΅ Π·Π°Π²Π΅Ρ€ΡˆΠΈΠ»ΠΎΡΡŒ*/) { //запускаСм ΠΎΡ‰Π΅ ΠΎΠ΄Π½Ρƒ копию с Π±ΠΎΠ»Π΅Π΅ Ρ‡Π΅ΠΌ 3 ΠΏΠ°Ρ€Π°ΠΌΠ΅Ρ‚Ρ€Π°ΠΌΠΈ i++; } if (i == 3) { state = false; } } std::cout << "Finished"; } else { std::cout << "COPY!"; } system("pause"); return 0; } 
  • Specify whether you need to control the running process, or just to check its existence? - PinkTux
  • @PinkTux for starters, test of its existence - Dmitry
  • If boost , then look towards boost :: interprocess . If you just check, then through the PID-files. - PinkTux
  • In boost there is no suitable library. boost.interprocess is only an interaction (mutexes, shared memory, message queues, etc.). boost.process ( highscore.de/boost/process ) never entered the library, the author didn’t have the patience to complete it. - Chorkov
  • Boost.Process can help - Vladimir Gamalyan

0