vvin/cmd_minmax.go

29 lines
515 B
Go
Raw Normal View History

2023-10-17 00:00:50 -04:00
//go:build windows
// +build windows
2023-10-16 09:51:11 -04:00
package vvin
2019-11-09 22:56:05 -05:00
type minCmd struct {
Restore bool `cli:"restore,r"`
}
func (c minCmd) Run(g globalCmd) {
if c.Restore {
2019-11-18 04:42:38 -05:00
showWindow.Call(uintptr(g.targetHandle), swRestore)
2019-11-09 22:56:05 -05:00
} else {
2019-11-18 04:42:38 -05:00
showWindow.Call(uintptr(g.targetHandle), smMinimize)
2019-11-09 22:56:05 -05:00
}
}
type maxCmd struct {
Restore bool `cli:"restore,r"`
}
func (c maxCmd) Run(g globalCmd) {
if c.Restore {
2019-11-18 04:42:38 -05:00
showWindow.Call(uintptr(g.targetHandle), swRestore)
2019-11-09 22:56:05 -05:00
} else {
2019-11-18 04:42:38 -05:00
showWindow.Call(uintptr(g.targetHandle), swMaximize)
2019-11-09 22:56:05 -05:00
}
}