private void OnLoaded(Object sender, EventArgs e)
{
int nStyle = Win32API.GetWindowLong(new WindowInteropHelper(this).Handle, Win32API.GWL_STYLE);
nStyle &= ~Win32API.WS_SYSMENU;
Win32API.SetWindowLong(new WindowInteropHelper(this).Handle, Win32API.GWL_STYLE, nStyle);
}
public class Win32API
{
public const int GWL_STYLE = -16;
public const int GWL_EXSTYLE = -20;
public const int WS_CAPTION = 0x00C00000;
public const int WS_SYSMENU = 0x00080000;
[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int newN);
[DllImport("user32.dll")]
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
}