>* nStartedProcessHandle = (((asc(subst(cProcessInfo,4,1))*256) + ; >* asc(subst(cProcessInfo,3,1)))*256 + ; >* asc(subst(cProcessInfo,2,1)))*256 + ; >* asc(left(cProcessInfo,1)) > > ** should be this > nStartedProcessHandle = (((asc(subst(cProcessInfo,4,1))*256^3) + ; > asc(subst(cProcessInfo,3,1)))*256^2 + ; > asc(subst(cProcessInfo,2,1)))*256 + ; > asc(left(cProcessInfo,1)) > > ** Get Thread handle also > ** Both handles must then be close using CloseHandle() API > hThread = (((asc(subst(cProcessInfo,8,1))*256^3) + ; > asc(subst(cProcessInfo,7,1)))*256^2 + ; > asc(subst(cProcessInfo,6,1)))*256 + ; > asc(left(cProcessInfo,5)) > >* =WaitInpIdle(GetCurrProc(),cnINFINITE) > > * Wait for the idle of the new/child process not the idle of the current process > WaitInpIdle( nStartedProcessHandle, cnINFINITE ) > > do while WaitOnAppExit(nStartedProcessHandle, cnHalfASecond) = cnTimedOut > >* Give us an out in case the other app hangs - lets the user quit via > if inkey() = 27 >* Still running but we aren't waiting - return a -1 as a warning > uResult = -1 > exit > endif > > enddo > > ** Process & Thread Handles must be close > ** or else it will remains in the system > Declare Long CloseHandle in Kernel32 Long hObject > > If (nStartedProcessHandle != 0) > CloseHandle( nStartedProcessHandle ) > endif > > If (hThread != 0) > CloseHandle( hThread ) > endif >