Exemplo n.º 1
0
        public static int ShowMessageBoxEx(string strContent, string strMainInstruction,
                                           string strWindowTitle, VtdIcon vtdIcon, Form fParent,
                                           string strButton1, int iResult1, string strButton2, int iResult2)
        {
            VistaTaskDialog vtd = new VistaTaskDialog();

            vtd.CommandLinks = false;

            if (strContent != null)
            {
                vtd.Content = strContent;
            }
            if (strMainInstruction != null)
            {
                vtd.MainInstruction = strMainInstruction;
            }
            if (strWindowTitle != null)
            {
                vtd.WindowTitle = strWindowTitle;
            }

            vtd.SetIcon(vtdIcon);

            bool bCustomButton = false;

            if (!string.IsNullOrEmpty(strButton1))
            {
                vtd.AddButton(iResult1, strButton1, null);
                bCustomButton = true;
            }
            if (!string.IsNullOrEmpty(strButton2))
            {
                vtd.AddButton(iResult2, strButton2, null);
                bCustomButton = true;
            }

            if (!vtd.ShowDialog(fParent))
            {
                return(-1);
            }
            return(bCustomButton ? vtd.Result : 0);
        }
Exemplo n.º 2
0
        public static bool ShowMessageBox(string strContent, string strMainInstruction,
                                          string strWindowTitle, VtdIcon vtdIcon, IntPtr hParent)
        {
            VistaTaskDialog vtd = new VistaTaskDialog(hParent);

            vtd.CommandLinks = false;

            if (strContent != null)
            {
                vtd.Content = strContent;
            }
            if (strMainInstruction != null)
            {
                vtd.MainInstruction = strMainInstruction;
            }
            if (strWindowTitle != null)
            {
                vtd.WindowTitle = strWindowTitle;
            }

            vtd.SetIcon(vtdIcon);

            return(vtd.ShowDialog());
        }
Exemplo n.º 3
0
 public void SetIcon(VtdIcon vtdIcon)
 {
     m_cfg.dwFlags  &= ~VtdFlags.UseHIconMain;
     m_cfg.hMainIcon = new IntPtr((int)vtdIcon);
 }
Exemplo n.º 4
0
 public void SetFooterIcon(VtdIcon vtdIcon)
 {
     m_cfg.dwFlags    &= ~VtdFlags.UseHIconFooter;
     m_cfg.hFooterIcon = new IntPtr((int)vtdIcon);
 }
Exemplo n.º 5
0
 public static bool ShowMessageBox(string strContent, string strMainInstruction,
                                   string strWindowTitle, VtdIcon vtdIcon, Form fParent)
 {
     return(ShowMessageBoxEx(strContent, strMainInstruction, strWindowTitle,
                             vtdIcon, fParent, null, 0, null, 0) >= 0);
 }
Exemplo n.º 6
0
 public void SetIcon(VtdIcon vtdIcon)
 {
     m_cfg.dwFlags &= ~VtdFlags.UseHIconMain;
     m_cfg.hMainIcon = new IntPtr((int)vtdIcon);
 }
Exemplo n.º 7
0
 public void SetFooterIcon(VtdIcon vtdIcon)
 {
     m_cfg.dwFlags &= ~VtdFlags.UseHIconFooter;
     m_cfg.hFooterIcon = new IntPtr((int)vtdIcon);
 }
Exemplo n.º 8
0
        public static int ShowMessageBoxEx(string strContent, string strMainInstruction,
            string strWindowTitle, VtdIcon vtdIcon, Form fParent,
            string strButton1, int iResult1, string strButton2, int iResult2)
        {
            VistaTaskDialog vtd = new VistaTaskDialog();

            vtd.CommandLinks = false;

            if(strContent != null) vtd.Content = strContent;
            if(strMainInstruction != null) vtd.MainInstruction = strMainInstruction;
            if(strWindowTitle != null) vtd.WindowTitle = strWindowTitle;

            vtd.SetIcon(vtdIcon);

            bool bCustomButton = false;
            if(!string.IsNullOrEmpty(strButton1))
            {
                vtd.AddButton(iResult1, strButton1, null);
                bCustomButton = true;
            }
            if(!string.IsNullOrEmpty(strButton2))
            {
                vtd.AddButton(iResult2, strButton2, null);
                bCustomButton = true;
            }

            if(!vtd.ShowDialog(fParent)) return -1;
            return (bCustomButton ? vtd.Result : 0);
        }
Exemplo n.º 9
0
        /* private int OnTaskDialogCallback(IntPtr hwnd, uint uNotification,
            UIntPtr wParam, IntPtr lParam, IntPtr lpRefData)
        {
            if((uNotification == (uint)VtdMsg.Created) ||
                (uNotification == (uint)VtdMsg.DialogConstructed))
                UpdateHWnd(hwnd);
            else if(uNotification == (uint)VtdMsg.Destroyed)
                UpdateHWnd(IntPtr.Zero);

            return 0;
        }

        private void UpdateHWnd(IntPtr hWnd)
        {
            if(hWnd != m_hWnd) { } // Unregister m_hWnd
            // Register hWnd
            m_hWnd = hWnd;
        } */
        public static bool ShowMessageBox(string strContent, string strMainInstruction,
            string strWindowTitle, VtdIcon vtdIcon, Form fParent)
        {
            return (ShowMessageBoxEx(strContent, strMainInstruction, strWindowTitle,
                vtdIcon, fParent, null, 0, null, 0) >= 0);
        }
Exemplo n.º 10
0
		public static bool ShowMessageBox(string strContent, string strMainInstruction,
			string strWindowTitle, VtdIcon vtdIcon, IntPtr hParent)
		{
			VistaTaskDialog vtd = new VistaTaskDialog(hParent);

			vtd.CommandLinks = false;

			if(strContent != null) vtd.Content = strContent;
			if(strMainInstruction != null) vtd.MainInstruction = strMainInstruction;
			if(strWindowTitle != null) vtd.WindowTitle = strWindowTitle;

			vtd.SetIcon(vtdIcon);

			return vtd.ShowDialog();
		}