2 using System.Collections.Generic;
6 using System.Windows.Controls;
7 using System.Windows.Data;
8 using System.Windows.Documents;
9 using System.Windows.Input;
10 using System.Windows.Media;
11 using System.Windows.Media.Imaging;
12 using System.Windows.Shapes;
13 using System.Runtime.InteropServices;
14 using System.Windows.Interop;
16 namespace SeciUserInterface.Forms
23 private const int GWL_STYLE = -16;
24 private const int WS_SYSMENU = 0x80000;
25 [DllImport(
"user32.dll", SetLastError =
true)]
26 private static extern int GetWindowLong(IntPtr hWnd,
int nIndex);
27 [DllImport(
"user32.dll")]
28 private static extern int SetWindowLong(IntPtr hWnd,
int nIndex,
int dwNewLong);
32 InitializeComponent();
33 txtMessage.Text = message;
37 WindowStartupLocation = System.Windows.WindowStartupLocation.CenterOwner;
41 WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
47 var hwnd =
new WindowInteropHelper(
this).Handle;
48 SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU);