fix: alpha 100% does not work without -t

This commit is contained in:
ShuheiKubota 2019-11-10 10:18:15 +09:00
parent 0bc5b39f10
commit 87cec80802

View file

@ -185,10 +185,9 @@ func (c alphaCmd) Run(args []string, g globalCmd) error {
style, _, _ := getWindowLong.Call(uintptr(g.targetHandle), GWL_EXSTYLE) style, _, _ := getWindowLong.Call(uintptr(g.targetHandle), GWL_EXSTYLE)
setWindowLong.Call(uintptr(g.targetHandle), GWL_EXSTYLE, style|WS_EX_LAYERED) setWindowLong.Call(uintptr(g.targetHandle), GWL_EXSTYLE, style|WS_EX_LAYERED)
setLayeredWindowAttributes.Call(uintptr(g.targetHandle), 0, uintptr(alpha), LWA_ALPHA)
if alpha == 255 { if alpha == 255 {
setWindowLong.Call(uintptr(g.targetHandle), GWL_EXSTYLE, style&^WS_EX_LAYERED) setWindowLong.Call(uintptr(g.targetHandle), GWL_EXSTYLE, style&^WS_EX_LAYERED)
} else {
setLayeredWindowAttributes.Call(uintptr(g.targetHandle), 0, uintptr(alpha), LWA_ALPHA)
} }
return nil return nil