Esempio n. 1
0
        protected override void OnSourceInitialized(EventArgs e)
        {
            IntPtr hWnd = (new WindowInteropHelper(this)).Handle;

            IntPtr style = MyWin32Interop.GetWindowLongPtr(hWnd, MyWin32Interop.GWL_EXSTYLE);

            style = (IntPtr)((int)style | MyWin32Interop.ExtendedWindowStyles.WS_EX_DLGMODALFRAME);
            MyWin32Interop.SetWindowLongPtr(hWnd, MyWin32Interop.GWL_EXSTYLE, style);

            if (m_DisableCloseButton)
            {
                style = MyWin32Interop.GetWindowLongPtr(hWnd, MyWin32Interop.GWL_STYLE);
                style = (IntPtr)((int)style & ~MyWin32Interop.WindowStyles.WS_SYSMENU);
                MyWin32Interop.SetWindowLongPtr(hWnd, MyWin32Interop.GWL_STYLE, style);
            }
        }