mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-02 23:23:55 +00:00
update set handle return and add getBounds func [ci skip]
This commit is contained in:
parent
fa1051211b
commit
e1769c70dc
11
robotgo.go
11
robotgo.go
@ -1398,6 +1398,17 @@ func GetPID() int32 {
|
|||||||
return int32(pid)
|
return int32(pid)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetBounds get the window bounds
|
||||||
|
func GetBounds(pid int32, args ...int) (int, int, int, int) {
|
||||||
|
var hwnd int
|
||||||
|
if len(args) > 0 {
|
||||||
|
hwnd = args[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
bounds := C.get_bounds(C.uintptr(pid), C.uintptr(hwnd))
|
||||||
|
return int(bounds.X), int(bounds.Y), int(bounds.W), int(bounds.H)
|
||||||
|
}
|
||||||
|
|
||||||
// Pids get the all process id
|
// Pids get the all process id
|
||||||
func Pids() ([]int32, error) {
|
func Pids() ([]int32, error) {
|
||||||
var ret []int32
|
var ret []int32
|
||||||
|
@ -170,8 +170,8 @@ bool setHandle(uintptr handle){
|
|||||||
mData.AxID = 0;
|
mData.AxID = 0;
|
||||||
|
|
||||||
if (handle == 0){
|
if (handle == 0){
|
||||||
return 0;
|
// return 0;
|
||||||
// return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve the window element
|
// Retrieve the window element
|
||||||
|
Loading…
Reference in New Issue
Block a user