예제 #1
0
 // Token: 0x0600058B RID: 1419 RVA: 0x00054B80 File Offset: 0x00052D80
 private static void Initialize()
 {
     if (WMMessageBox._hHook != IntPtr.Zero)
     {
         throw new NotSupportedException("multiple calls are not supported");
     }
     if (WMMessageBox._owner != null)
     {
         WMMessageBox._hHook = WMMessageBox.SetWindowsHookEx(12, WMMessageBox._hookProc, IntPtr.Zero, AppDomain.GetCurrentThreadId());
     }
 }
예제 #2
0
 // Token: 0x0600057A RID: 1402 RVA: 0x00054AD6 File Offset: 0x00052CD6
 public static DialogResult Show(IWin32Window owner, string text)
 {
     // 添加了非阻塞的标记 实现非阻塞不弹出提示框只记录阻塞提醒待后续操作
     if (Program.MsgBoxNonBlocking)
     {
         Program.MsgBoxMessage = text;
         return(DialogResult.OK);
     }
     else
     {
         WMMessageBox._owner = owner;
         WMMessageBox.Initialize();
         return(MessageBox.Show(owner, text));
     }
 }
예제 #3
0
        // Token: 0x0600058D RID: 1421 RVA: 0x00054C44 File Offset: 0x00052E44
        private static void CenterWindow(IntPtr hChildWnd)
        {
            Rectangle rectangle = new Rectangle(0, 0, 0, 0);

            WMMessageBox.GetWindowRect(hChildWnd, ref rectangle);
            int       num        = rectangle.Width - rectangle.X;
            int       num2       = rectangle.Height - rectangle.Y;
            Rectangle rectangle2 = new Rectangle(0, 0, 0, 0);

            WMMessageBox.GetWindowRect(WMMessageBox._owner.Handle, ref rectangle2);
            Point point = new Point(0, 0);

            point.X = rectangle2.X + (rectangle2.Width - rectangle2.X) / 2;
            point.Y = rectangle2.Y + (rectangle2.Height - rectangle2.Y) / 2;
            Point point2 = new Point(0, 0);

            point2.X = point.X - num / 2;
            point2.Y = point.Y - num2 / 2;
            point2.X = ((point2.X < 0) ? 0 : point2.X);
            point2.Y = ((point2.Y < 0) ? 0 : point2.Y);
            WMMessageBox.MoveWindow(hChildWnd, point2.X, point2.Y, num, num2, false);
        }
예제 #4
0
        // Token: 0x0600058C RID: 1420 RVA: 0x00054BC0 File Offset: 0x00052DC0
        private static IntPtr MessageBoxHookProc(int nCode, IntPtr wParam, IntPtr lParam)
        {
            if (nCode < 0)
            {
                return(WMMessageBox.CallNextHookEx(WMMessageBox._hHook, nCode, wParam, lParam));
            }
            WMMessageBox.CWPRETSTRUCT cwpretstruct = (WMMessageBox.CWPRETSTRUCT)Marshal.PtrToStructure(lParam, typeof(WMMessageBox.CWPRETSTRUCT));
            IntPtr hHook = WMMessageBox._hHook;

            if (cwpretstruct.message == 5U)
            {
                try
                {
                    WMMessageBox.CenterWindow(cwpretstruct.hwnd);
                }
                finally
                {
                    WMMessageBox.UnhookWindowsHookEx(WMMessageBox._hHook);
                    WMMessageBox._hHook = IntPtr.Zero;
                }
            }
            return(WMMessageBox.CallNextHookEx(hHook, nCode, wParam, lParam));
        }
예제 #5
0
 // Token: 0x0600057E RID: 1406 RVA: 0x00054B2D File Offset: 0x00052D2D
 public static DialogResult Show(IWin32Window owner, string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton)
 {
     WMMessageBox._owner = owner;
     WMMessageBox.Initialize();
     return(MessageBox.Show(owner, text, caption, buttons, icon, defButton));
 }
예제 #6
0
 // Token: 0x0600057B RID: 1403 RVA: 0x00054AEA File Offset: 0x00052CEA
 public static DialogResult Show(IWin32Window owner, string text, string caption)
 {
     WMMessageBox._owner = owner;
     WMMessageBox.Initialize();
     return(MessageBox.Show(owner, text, caption));
 }
예제 #7
0
 // Token: 0x06000579 RID: 1401 RVA: 0x00054AC2 File Offset: 0x00052CC2
 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon, MessageBoxDefaultButton defButton, MessageBoxOptions options)
 {
     WMMessageBox.Initialize();
     return(MessageBox.Show(text, caption, buttons, icon, defButton, options));
 }
예제 #8
0
 // Token: 0x06000577 RID: 1399 RVA: 0x00054AA0 File Offset: 0x00052CA0
 public static DialogResult Show(string text, string caption, MessageBoxButtons buttons, MessageBoxIcon icon)
 {
     WMMessageBox.Initialize();
     return(MessageBox.Show(text, caption, buttons, icon));
 }
예제 #9
0
 // Token: 0x06000575 RID: 1397 RVA: 0x00054A83 File Offset: 0x00052C83
 public static DialogResult Show(string text, string caption)
 {
     WMMessageBox.Initialize();
     return(MessageBox.Show(text, caption));
 }