Пример #1
0
        public static void DisableControlBox(this Window window)
        {
            WindowInteropHelper windowInteropHelper = new WindowInteropHelper(window);

            Int64 windowLong = WindowClass.GetWindowLong(windowInteropHelper.EnsureHandle(), WindowClass.GWL_STYLE);

            WindowClass.SetWindowLong(windowInteropHelper.EnsureHandle(), WindowClass.GWL_STYLE, (Int32)(windowLong & ~WindowStyles.WS_SYSMENU));
        }
Пример #2
0
        public static void DisableMinimizeBox(this Window window)
        {
            WindowInteropHelper windowInteropHelper = new WindowInteropHelper(window);

            Int64 windowLong = WindowClass.GetWindowLong(windowInteropHelper.EnsureHandle(), WindowClass.GWL_STYLE);

            WindowClass.SetWindowLong(windowInteropHelper.EnsureHandle(), WindowClass.GWL_STYLE, (Int32)(windowLong & ~WindowStyles.WS_MINIMIZEBOX));
        }