mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-04 16:03:54 +00:00
simplified max and min window api
This commit is contained in:
parent
2a461274b6
commit
e4a8b1f854
26
robotgo.go
26
robotgo.go
@ -1287,20 +1287,34 @@ func GetActive() C.MData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// MinWindow set the window min
|
// MinWindow set the window min
|
||||||
func MinWindow(pid int32, state bool, args ...int) {
|
func MinWindow(pid int32, args ...interface{}) {
|
||||||
var hwnd int
|
var (
|
||||||
|
state = true
|
||||||
|
hwnd int
|
||||||
|
)
|
||||||
|
|
||||||
if len(args) > 0 {
|
if len(args) > 0 {
|
||||||
hwnd = args[0]
|
state = args[0].(bool)
|
||||||
|
}
|
||||||
|
if len(args) > 1 {
|
||||||
|
hwnd = args[1].(int)
|
||||||
}
|
}
|
||||||
|
|
||||||
C.min_window(C.uintptr(pid), C.bool(state), C.uintptr(hwnd))
|
C.min_window(C.uintptr(pid), C.bool(state), C.uintptr(hwnd))
|
||||||
}
|
}
|
||||||
|
|
||||||
// MaxWindow set the window max
|
// MaxWindow set the window max
|
||||||
func MaxWindow(pid int32, state bool, args ...int) {
|
func MaxWindow(pid int32, args ...interface{}) {
|
||||||
var hwnd int
|
var (
|
||||||
|
state = true
|
||||||
|
hwnd int
|
||||||
|
)
|
||||||
|
|
||||||
if len(args) > 0 {
|
if len(args) > 0 {
|
||||||
hwnd = args[0]
|
state = args[0].(bool)
|
||||||
|
}
|
||||||
|
if len(args) > 1 {
|
||||||
|
hwnd = args[1].(int)
|
||||||
}
|
}
|
||||||
|
|
||||||
C.max_window(C.uintptr(pid), C.bool(state), C.uintptr(hwnd))
|
C.max_window(C.uintptr(pid), C.bool(state), C.uintptr(hwnd))
|
||||||
|
Loading…
Reference in New Issue
Block a user