Purpose With TerminateProcess you can terminate a process started with  Start ... returnId=... . GuiXT simulates the closing of the application by the user.
Examplel TerminateProcess id="&V[proc]"  

Here the variable V[proc] needs to be filled before by a Start ... returnId="proc" command.

Format TerminateProcess id="processId"

The main window of the application is closed. If the application normally displays a security popup before terminating the application, the popup is also shown when you use TerminateProcess. The user may then decide not to close the application. So you cannot be sure that the underlying process is really terminated after executing TerminateProcess.
The initial process referred to by the PID might also not be the process which ends up holding the file or application.
Common cases include:

  • A .pdf document being opened in the web browser, in addition to already open tabs
  • A .doc file being opened and edited in Word, prompting the user to save changes before closing
  • An image file being opened in Photos.exe, which instead creates a self-terminating process no longer referred to by the PID
  • Similarly, a .bat script running under cmd.exe
Components GuiXT + InputAssistant