This commit is contained in:
429Enjoyer committed 2026-05-19 14:28:05 +07:00
1 parent 33be717065
commit e05a9379fc
20 files changed
+1449 -611

No files matched your search

+15
View File
@@ -4,6 +4,7 @@ package backend
import (
"os/exec"
"strconv"
"syscall"
)
@@ -13,3 +14,17 @@ func hideWindow(cmd *exec.Cmd) {
CreationFlags: 0x08000000,
}
}
func terminateCommandProcess(cmd *exec.Cmd) error {
if cmd == nil || cmd.Process == nil {
return nil
}
taskkill := exec.Command("taskkill", "/T", "/F", "/PID", strconv.Itoa(cmd.Process.Pid))
hideWindow(taskkill)
if err := taskkill.Run(); err == nil {
return nil
}
return cmd.Process.Kill()
}