func (w *Window) LockSize(lock bool) { prevStyle := int(w32.GetWindowLongPtr(w.hwnd, w32.GWL_STYLE)) if lock { prevStyle &= ^(w32.WS_MAXIMIZEBOX | w32.WS_SIZEBOX) } else { prevStyle |= w32.WS_MAXIMIZEBOX | w32.WS_SIZEBOX } w32.SetWindowLongPtr(w.hwnd, w32.GWL_STYLE, uintptr(prevStyle)) }
func ToggleExStyle(hwnd w32.HWND, b bool, style int) { originalStyle := int(w32.GetWindowLongPtr(hwnd, w32.GWL_EXSTYLE)) if originalStyle != 0 { if b { originalStyle |= style } else { originalStyle ^= style } w32.SetWindowLongPtr(hwnd, w32.GWL_EXSTYLE, uintptr(originalStyle)) } }