From 6c9f130b2e7e02c856b954f417e4e560bed7a4f1 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Tue, 12 Mar 2013 12:49:13 +0000 Subject: [PATCH] windows setup: remove close button. fixes #1215 --- SparkleShare/Windows/SparkleSetupWindow.cs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/SparkleShare/Windows/SparkleSetupWindow.cs b/SparkleShare/Windows/SparkleSetupWindow.cs index c5dc64c2..21002054 100644 --- a/SparkleShare/Windows/SparkleSetupWindow.cs +++ b/SparkleShare/Windows/SparkleSetupWindow.cs @@ -55,8 +55,14 @@ namespace SparkleShare { WindowStartupLocation = WindowStartupLocation.CenterScreen; Content = ContentCanvas; - + + // Remove the close button Closing += Close; + SourceInitialized += delegate { + WindowInteropHelper helper = new WindowInteropHelper (this); + int style = GetWindowLong (helper.Handle, -16); + SetWindowLong (helper.Handle, -16, style & ~0×00080000); + }; this.bar = new Rectangle () { Width = Width, @@ -69,8 +75,7 @@ namespace SparkleShare { Height = 1, Fill = new SolidColorBrush (Color.FromRgb (223, 223, 223)) }; - - + this.side_splash = new Image () { Width = 150, Height = 482 @@ -173,5 +178,12 @@ namespace SparkleShare { { args.Cancel = true; } + + + [DllImport("user32.dll")] + private extern static int SetWindowLong (IntPtr hwnd, int index, int value); + + [DllImport("user32.dll")] + private extern static int GetWindowLong (IntPtr hwnd, int index); } }