public void ShowDialog(params PROGDLG[] flags)
        {
            if (pd == null)
            {
                pd = (Win32IProgressDialog) new Win32ProgressDialog();

                pd.SetTitle(this.title);
                pd.SetCancelMsg(this.cancelMessage, null);
                pd.SetLine(1, this.line1, false, IntPtr.Zero);
                pd.SetLine(2, this.line2, false, IntPtr.Zero);
                pd.SetLine(3, this.line3, false, IntPtr.Zero);

                PROGDLG dialogFlags = PROGDLG.Normal;
                if (flags.Length != 0)
                {
                    dialogFlags = flags[0];
                    for (var i = 1; i < flags.Length; i++)
                    {
                        dialogFlags = dialogFlags | flags[i];
                    }
                }

                pd.StartProgressDialog(this.parentHandle, null, dialogFlags, IntPtr.Zero);
            }
        }
Example #2
0
 public void CloseDialog()
 {
     if (this.pd != null)
     {
         this.pd.StopProgressDialog();
         this.pd = null;
     }
 }
 public void CloseDialog()
 {
     if (pd != null)
     {
         pd.StopProgressDialog();
         Marshal.ReleaseComObject(pd);
         pd = null;
     }
 }
Example #4
0
        public void CloseDialog()
        {
            if (pd != null)
            {
                pd.StopProgressDialog();

                pd = null;
            }
        }
Example #5
0
 public void ShowDialog(params PROGDLG[] flags)
 {
     if (this.pd == null)
     {
         this.pd = (Win32IProgressDialog) new Win32ProgressDialog();
         this.pd.SetTitle(this._Title);
         this.pd.SetCancelMsg(this._CancelMessage, null);
         this.pd.SetLine(1, this._Line1, false, IntPtr.Zero);
         this.pd.SetLine(2, this._Line2, false, IntPtr.Zero);
         this.pd.SetLine(3, this._Line3, false, IntPtr.Zero);
         PROGDLG normal = PROGDLG.Normal;
         if (flags.Length != 0)
         {
             normal = flags[0];
             for (int i = 1; i < flags.Length; i++)
             {
                 normal |= flags[i];
             }
         }
         this.pd.StartProgressDialog(this._parentHandle, null, normal, IntPtr.Zero);
     }
 }
Example #6
0
        public void ShowDialog(IntPtr ownerHandle)
        {
            if (pd == null)
            {
                pd = (Win32IProgressDialog) new Win32ProgressDialog();

                pd.SetTitle(this._title);
                pd.SetCancelMsg(this._cancelMessage, null);
                pd.SetLine(1, this._line1, false, IntPtr.Zero);
                pd.SetLine(2, this._line2, false, IntPtr.Zero);
                pd.SetLine(3, this._line3, false, IntPtr.Zero);

                PROGDLG dialogFlags = PROGDLG.Normal;
                if (Modal)
                {
                    dialogFlags |= PROGDLG.Modal;
                }
                if (AutoTime)
                {
                    dialogFlags |= PROGDLG.AutoTime;
                }
                if (NoTime)
                {
                    dialogFlags |= PROGDLG.NoTime;
                }
                if (NoMinimize)
                {
                    dialogFlags |= PROGDLG.NoMinimize;
                }
                if (NoProgressBar)
                {
                    dialogFlags |= PROGDLG.NoProgressBar;
                }

                pd.StartProgressDialog(ownerHandle, null, dialogFlags, IntPtr.Zero);

                if (Animation != Animations.None)
                {
                    var attributes = (AnimationInfoAttribute[])(typeof(Animations).GetField(Animation.ToString()).GetCustomAttributes(typeof(AnimationInfoAttribute), false));
                    if (attributes.Length > 0)
                    {
                        string originalDirectory = Environment.CurrentDirectory;
                        Environment.CurrentDirectory = Environment.GetFolderPath(Environment.SpecialFolder.System);
                        try
                        {
                            IntPtr moduleHandle = GetModuleHandle(attributes[0].Filename);
                            if (moduleHandle == IntPtr.Zero)
                            {
                                moduleHandle = LoadLibrary(attributes[0].Filename);
                            }
                            if (moduleHandle != IntPtr.Zero)
                            {
                                var gch = GCHandle.Alloc(moduleHandle);
                                pd.SetAnimation(moduleHandle, attributes[0].ResourceId);
                                gch.Free();
                            }
                        }
                        catch { }
                        Environment.CurrentDirectory = originalDirectory;
                    }
                }
            }
        }
Example #7
0
 public void ShowDialog(params PROGDLG[] flags)
 {
     if (this.pd == null)
     {
         this.pd = (Win32IProgressDialog) new Win32ProgressDialog();
         this.pd.SetTitle(this._Title);
         this.pd.SetCancelMsg(this._CancelMessage, null);
         this.pd.SetLine(1, this._Line1, false, IntPtr.Zero);
         this.pd.SetLine(2, this._Line2, false, IntPtr.Zero);
         this.pd.SetLine(3, this._Line3, false, IntPtr.Zero);
         PROGDLG normal = PROGDLG.Normal;
         if (flags.Length != 0)
         {
             normal = flags[0];
             for (int i = 1; i < flags.Length; i++)
             {
                 normal |= flags[i];
             }
         }
         this.pd.StartProgressDialog(this._parentHandle, null, normal, IntPtr.Zero);
     }
 }
Example #8
0
 public void CloseDialog()
 {
     if (this.pd != null)
     {
         this.pd.StopProgressDialog();
         this.pd = null;
     }
 }
Example #9
0
 /// <summary>
 /// Show Progress Dialog
 /// </summary>
 /// <param name="flags">Parameter of dialog flags. (comma separated)</param>
 /// <seealso cref="PROGDLG"/>
 public void ShowDialog(params PROGDLG[] flags)
 {
     if (pd == null)
     {
         pd = (Win32IProgressDialog)new Win32ProgressDialog();
         pd.SetTitle(this._Title);
         pd.SetLine(1, this._Line1, false, IntPtr.Zero);
         pd.SetLine(2, this._Line2, false, IntPtr.Zero);
         pd.SetLine(3, this._Line3, false, IntPtr.Zero);
         PROGDLG dialogFlags = PROGDLG.Normal;
         if (flags.Length != 0)
         {
             dialogFlags = flags[0];
             for (var i = 1; i < flags.Length; i++)
             {
                 dialogFlags = dialogFlags | flags[i];
             }
         }
         pd.SetAnimation(this._parentHandle, this._animation);
         pd.StartProgressDialog(this._parentHandle, null, dialogFlags, IntPtr.Zero);
     }
 }
Example #10
0
 /// <summary>
 /// Close Dialog
 /// </summary>
 public void CloseDialog()
 {
     if (pd != null)
     {
         pd.StopProgressDialog();
         //Marshal.ReleaseComObject(pd);
         pd = null;
     }
 }