Multitasking Shell Command

Windows specific questions.
Post Reply
PyRoe
Posts: 61
Joined: Sep 07, 2005 16:10
Location: not quite sure, i just woke up here

Multitasking Shell Command

Post by PyRoe »

Ok this is a little weird, but i have a desire to create a program which will call a second program, but not interrupt the execution of the first program until the second one is complete... I know this is weird but it will be handy for it.... any ideas how to do this?
TJF
Posts: 3809
Joined: Dec 06, 2009 22:27
Location: N47°, E15°
Contact:

Post by TJF »

Code: Select all

#IFNDEF __FB_UNIX__
SHELL "start second_prg.exe"
#ELSE
SHELL "second_prg &"
#ENDIF
pestery
Posts: 493
Joined: Jun 16, 2007 2:00
Location: Australia

Post by pestery »

You could create a new thread and use Chain or Exec from within the new thread.
AnotherLife
Posts: 94
Joined: Feb 07, 2011 22:48

Post by AnotherLife »

I propose this solution :

http://msrtech.blogspot.com/2009/01/cre ... ocess.html

Code: Select all

// Create the process
PROCESS_INFORMATION pi;
CreateProcess(..., &pi);

// Wait for it to finish
WaitForSingleObject(pi.hProcess, INFINITE);

Above statement keeps current process in suspension till CreateProcess binary is done with its task. 
Post Reply