update set handle return and add getBounds func [ci skip]

This commit is contained in:
vcaesar 2018-08-13 09:11:45 -04:00
parent fa1051211b
commit e1769c70dc
2 changed files with 13 additions and 2 deletions

View File

@ -1398,6 +1398,17 @@ func GetPID() int32 {
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
func Pids() ([]int32, error) {
var ret []int32

View File

@ -170,8 +170,8 @@ bool setHandle(uintptr handle){
mData.AxID = 0;
if (handle == 0){
return 0;
// return true;
// return 0;
return true;
}
// Retrieve the window element