Пример #1
0
        public MsgBoxResult Show(string text, string caption = null, MsgBoxButtons buttons = 0, MsgBoxIcon icon = 0, MsgBoxFlags flags = 0)
        {
            if (hWnd != IntPtr.Zero && CenterOwner)
            {
                IntPtr hInst = GetWindowLong(hWnd, GWL.HINSTANCE);
                IntPtr thrId = GetCurrentThreadId();
                hook = SetWindowsHookEx(WH.CBT, HookPrc, hInst, thrId);
            }

            return((MsgBoxResult)MessageBox(hWnd, text, caption, (MB)buttons | (MB)icon | (MB)flags));
        }
Пример #2
0
 public static MsgBoxResult Show(IntPtr hWnd, string text, string caption = null, MsgBoxButtons buttons = 0, MsgBoxIcon icon = 0, MsgBoxFlags flags = 0)
 {
     return((MsgBoxResult)MessageBox(hWnd, text, caption, (MB)buttons | (MB)icon | (MB)flags));
 }
Пример #3
0
 public MsgBoxResult MessageBox(string text, string caption = null, MsgBoxButtons buttons = 0, MsgBoxIcon icon = 0, MsgBoxFlags flags = 0)
 {
     return(msgBox.Show(text, caption ?? App.AppName, buttons, icon, flags));
 }