This is a test example:
(1). simple program that runs an infinite loop:
#include <iostream>
using namespace std;
int main() {
int counter = 0;
while (1) cout << ++counter << ": endless loop..." <<endl;
}
(2). another program running the above example with the command system():
#include <iostream>
#include <windows.h>
using namespace std;
int main() {
system("endless_loop.exe");
cout << "back to main program" << endl;
}
When executed Ctrl+Break, the program back to main programdoes not appear in this text . How to limit this key combination inside the process and return the progress bar back to the main application?
Another thing is that I do not always control the source code inside the program, so I can not change anything.
rsk82 source
share