The KillAppChildren function kills the specified application and its child processes.
ret = KillAppChildren(<application_name>, 0|1 [, <userid>])
<application_name>. string, name of the application to kill (a .EXE, case insensitive). The extension can be omitted. All the instances of the application and its child processes are killed. If the application A calls B, which calls C - if for any reason, B is killed, a KillAppChildren of A won't be able to kill the child C.
0|1. If 1, the application is killed immediately. If 0, a confirmation dialog box is displayed; after 60 seconds, the application is killed.
<userid>, string. If specified, KillAppChildren kills only the instances of the specified application which have been started by <userid>.
ret, optional integer return value. If the application has been killed successfully, the return value is 0. If the application has been killed successfully after the user confirmation, the return value is 1. If the function fails, the return value is a negative value (see System Functions Error Codes).
'The script below launches Notepad, types some text and exits. A dialog box is displayed asking if the document has to be saved.
'As KillAppChildren is used with the 1 flag, the application Notepad is killed immediately.
'Kill notepad and its children immediately