What are we talking about? Required:
- Launch the application with a * .exe file with parameters (parameters passed to main programs and application launch parameters (minimized window, windowless mode))
- 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)
- 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; }
boost, then look towards boost :: interprocess . If you just check, then through the PID-files. - PinkTux