简体   繁体   English

Node JS Windows子进程退出和关闭事件

[英]Node js windows child process on exit and close event

Hi i am trying to invoke an event on closing of calculator.exe application,but the event itself raising while launching the application.. any help ? 嗨,我正在尝试在关闭Calculator.exe应用程序时调用一个事件,但是在启动该应用程序时该事件本身会升高..有帮助吗?

var filePath="calc.exe";
var bat = exec(filePath);
bat.on('exit', function() {
 alert("exit");
});

Try replacing "exit" with "SIGINT" instead: 尝试将“ exit”替换为“ SIGINT”:

bat.on('SIGINT', function() {
 alert("exit");
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM