008
05.07.2004, 18:54 Uhr
cesa
|
Probier mal das
C++: |
TStartupInfo stgStartupInfo; TProcessInformation stgProcessInfo;
void StartApp(AnsiString); // Startet Programm void CloseApp(void); // Beendet Programm
//--------------------------------------------------------------- // Startet das Programm slProgr //--------------------------------------------------------------- void StartApp(AnsiString slProgr) { setmem(&stgStartupInfo,sizeof(TStartupInfo),0); stgStartupInfo.cb = sizeof(TStartupInfo); CreateProcess(NULL,slProgr.c_str(),NULL,NULL, false,NORMAL_PRIORITY_CLASS, NULL,ExtractFilePath(slProgr).c_str(), &stgStartupInfo,&stgProcessInfo); }
//--------------------------------------------------------------- // Beendet das Programm, sofern gestartet //--------------------------------------------------------------- void CloseApp(void) { TerminateProcess(stgProcessInfo.hProcess,0); }
|
|