/* C:Users[UserName]AppDataRoamingMicrosoftWindowsStart MenuProgramsStartupScreenCapture.ahk ^ : Ctrl ! : Alt + : Shift # : Win The hotkey is Ctrl+Alt+A */ ^!A::Run "D:pathtoScreenCapture.exe"
然后双击运行一下这个.ahk脚本文件,现在就可以按下Ctrl+Alt+A 启动截图应用了。
而且系统重启后,这个快捷键还是可用的。
如果你想把这个程序集成到Electron或Node应用中,可以参考下面这段代码
let spawn = require("child_process").spawn; let child = spawn("./path/to/ScreenCapture.exe") child.on("close", (code) => { /// when code is: /// 0 undefined /// 1 quit by press close btn; /// 2 quit by press right mouse btn; /// 3 quit by press esc keyboard /// 4 quit when copy rgb color /// 5 quit when copy hex color /// 6 quit when save to file /// 7 quit when save to clipboard console.log("the quit code is:",code) });