private void Window_SourceInitialized(object sender, EventArgs ea) { IntPtr hwnd = new WindowInteropHelper((Window)sender).Handle; int value = NativeMethods.GetWindowLong(hwnd, GWL_STYLE); NativeMethods.SetWindowLong(hwnd, GWL_STYLE, value & ~WS_MAXIMIZEBOX); WindowAspectRatio.Register((ViewWindow)sender); }
private void Window_SourceInitialized(object sender, EventArgs ea) { var hwnd = new WindowInteropHelper((Window)sender).Handle; var value = GetWindowLong(hwnd, GWL_STYLE); SetWindowLong(hwnd, GWL_STYLE, (int)(value & ~WS_MAXIMIZEBOX)); WindowAspectRatio.Register((ViewWindow)sender); }