mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
add process FindPath() function
This commit is contained in:
parent
d768b5e315
commit
0d402e0432
15
robotgo.go
15
robotgo.go
@ -1714,6 +1714,21 @@ func FindIds(name string) ([]int32, error) {
|
|||||||
return pids, err
|
return pids, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FindPath find the process path by the process pid
|
||||||
|
func FindPath(pid int32) (string, error) {
|
||||||
|
nps, err := process.NewProcess(pid)
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
f, err := nps.Exe()
|
||||||
|
if err != nil {
|
||||||
|
return "", err
|
||||||
|
}
|
||||||
|
|
||||||
|
return f, err
|
||||||
|
}
|
||||||
|
|
||||||
func internalActive(pid int32, hwnd int) {
|
func internalActive(pid int32, hwnd int) {
|
||||||
C.active_PID(C.uintptr(pid), C.uintptr(hwnd))
|
C.active_PID(C.uintptr(pid), C.uintptr(hwnd))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user