mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-01 06:33:56 +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
|
||||
func MinWindow(pid int32, state bool, args ...int) {
|
||||
var hwnd int
|
||||
func MinWindow(pid int32, args ...interface{}) {
|
||||
var (
|
||||
state = true
|
||||
hwnd int
|
||||
)
|
||||
|
||||
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))
|
||||
}
|
||||
|
||||
// MaxWindow set the window max
|
||||
func MaxWindow(pid int32, state bool, args ...int) {
|
||||
var hwnd int
|
||||
func MaxWindow(pid int32, args ...interface{}) {
|
||||
var (
|
||||
state = true
|
||||
hwnd int
|
||||
)
|
||||
|
||||
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))
|
||||
|
Loading…
Reference in New Issue
Block a user