Created
July 15, 2016 16:52
-
-
Save imchao9/b1f26504eef269c4a9399a63038f6528 to your computer and use it in GitHub Desktop.
Nw.js 监听窗口关闭
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var win = nw.Window.get(); | |
| var child_process = require('child_process'); | |
| var path = require('path'); | |
| win.on('close', function() { | |
| child_process.exec(path.dirname(process.execPath)+'\\stop-server.bat'); | |
| win.close(true); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment