mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 14:43:55 +00:00
update set handle by pid and add get handle mdata by pid
This commit is contained in:
parent
5a710f6198
commit
c4e7fbb392
12
robotgo.go
12
robotgo.go
@ -1382,7 +1382,17 @@ func SetHandle(hwnd int) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SetHandlePid set the window handle by pid
|
// SetHandlePid set the window handle by pid
|
||||||
func SetHandlePid(pid int32, args ...int32) C.MData {
|
func SetHandlePid(pid int32, args ...int32) {
|
||||||
|
var isHwnd int32
|
||||||
|
if len(args) > 0 {
|
||||||
|
isHwnd = args[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
C.set_handle_pid_mData(C.uintptr(pid), C.uintptr(isHwnd))
|
||||||
|
}
|
||||||
|
|
||||||
|
// GetHandPid get handle mdata by pid
|
||||||
|
func GetHandPid(pid int32, args ...int32) C.MData {
|
||||||
var isHwnd int32
|
var isHwnd int32
|
||||||
if len(args) > 0 {
|
if len(args) > 0 {
|
||||||
isHwnd = args[0]
|
isHwnd = args[0]
|
||||||
|
@ -69,6 +69,11 @@ MData set_handle_pid(uintptr pid, uintptr isHwnd){
|
|||||||
return win;
|
return win;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void set_handle_pid_mData(uintptr pid, uintptr isHwnd){
|
||||||
|
MData win = set_handle_pid(pid, isHwnd);
|
||||||
|
mData = win;
|
||||||
|
}
|
||||||
|
|
||||||
bool IsValid(){
|
bool IsValid(){
|
||||||
initWindow(initHandle);
|
initWindow(initHandle);
|
||||||
if (!IsAxEnabled(true)) {
|
if (!IsAxEnabled(true)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user