mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
add kill the process
This commit is contained in:
parent
b1d4b3a101
commit
18029106ac
@ -48,6 +48,7 @@ import "C"
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
// "fmt"
|
// "fmt"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
@ -59,7 +60,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version string = "v0.46.6.407, Pyrenees Mountains!"
|
version string = "v0.46.6.428, Pyrenees Mountains!"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetVersion get version
|
// GetVersion get version
|
||||||
@ -900,3 +901,9 @@ func FindIds(name string) ([]int32, error) {
|
|||||||
func ActivePID(pid int32) {
|
func ActivePID(pid int32) {
|
||||||
C.active_PID(C.uintptr(pid))
|
C.active_PID(C.uintptr(pid))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kill kill the process by PID
|
||||||
|
func Kill(pid int) error {
|
||||||
|
ps := os.Process{Pid: pid}
|
||||||
|
return ps.Kill()
|
||||||
|
}
|
||||||
|
@ -51,6 +51,7 @@ import "C"
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
// "fmt"
|
// "fmt"
|
||||||
|
"os"
|
||||||
"reflect"
|
"reflect"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
@ -62,7 +63,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
version string = "v0.46.6.423, Pyrenees Mountains!"
|
version string = "v0.46.6.428, Pyrenees Mountains!"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetVersion get version
|
// GetVersion get version
|
||||||
@ -1131,3 +1132,9 @@ func FindIds(name string) ([]int32, error) {
|
|||||||
func ActivePID(pid int32) {
|
func ActivePID(pid int32) {
|
||||||
C.active_PID(C.uintptr(pid))
|
C.active_PID(C.uintptr(pid))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kill kill the process by PID
|
||||||
|
func Kill(pid int) error {
|
||||||
|
ps := os.Process{Pid: pid}
|
||||||
|
return ps.Kill()
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user