Run into a bit of a problem here. I am creating a program that allows the user to add perl scripts to a queue and when the user clicks "Go" then the program calls and runs each script in order.
The problem I am having is how does my code know when a perl script is finished so that it can start the next one WITHOUT having my program stop completely while it waits? I don't want the program to wait because many of the perl scripts take several hours and I want the user to be able to continually add to the queue even if a script is running. I'm not picky about which executable running method I use (ie ShellExecute, CreateProcess, etc), I'm OK with whatever works best to accomplish this. Basically what I am looking for is a message sent to my window proc that says "Hey, the last program just ended, so its time to pop the queue and run the next program". Something like this:
Code:..... LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { ..... case BUTTON_GO: runTopScript(); break; case LATEST_PROGRAM_JUST_FINISHED: runTopScript(); break; ...... } } void runTopScript() { // if queue is not empty, pop top of queue and run that perl script }