spabb,
Try this following chunk of code. I have not run this exact incarnation of this procedure, but it is extracted from a procedure that I use all the time. The code uses the CreateProcess() procedure from the Win32 API:
-----------------------------------------------------------
void __fastcall TformMain::MenuItemClick(TObject *Sender)
{
// Perform setup to spawn the external process... process.
STARTUPINFO StartupInfo;
ZeroMemory(&StartupInfo,sizeof(STARTUPINFO));
PROCESS_INFORMATION ProcessInfo;
StartupInfo.cb = sizeof(STARTUPINFO);
AnsiString s = "<name of external program>";
//
// Spawn the program, then await its completion.
//
if( CreateProcess(s.c_str(),"",NULL,NULL,TRUE,
NORMAL_PRIORITY_CLASS,NULL,NULL,&StartupInfo,&ProcessInfo) )
{
WaitForSingleObject( ProcessInfo.hProcess,INFINITE);
CloseHandle(ProcessInfo.hProcess);
CloseHandle(ProcessInfo.hThread);
//
}
else
ShowMessage((AnsiString)"Unable to Find Program(s). " + s.c_str());
}
--------------------------------------------------------
Hope this works for you!
Bob Gallaway