Ho can i Terminate a Process that i could created with createprocess under MacOS X.
Here is my sample program:
Here is my sample program:
Global linepipe$ Global lineerro$ Global window:TGadget Global m Global timer window=CreateWindow("MusicTimer",40,40,320,240) button=CreateButton("Start",30,30,150,24,window,BUTTON_OK) Repeat WaitEvent() minuten:String=Mid$(CurrentTime$(),4,2) m=minuten.toint() Print m+" "+timer If ButtonState(button) = True Then SetButtonState(button,False) Print CurrentTime$() timer=m+2 Print m Print timer Process:TProcess = CreateProcess("/Applications/iTunes.app/Contents/MacOS/./iTunes") While Process.Status() If Process.err.ReadAvail() Or Process.pipe.ReadAvail() Then linepipe = Process.pipe.ReadLine() lineerro = Process.err.ReadLine() If linepipe <> "" Then Print linepipe EndIf If lineerro <> "" Then Print lineerro EndIf EndIf If m=timer Then TerminateProcess(Process:TProcess) EndIf Wend EndIf Forever